diff options
| -rw-r--r-- | locales/help_docs/en.yml | 4 | ||||
| -rw-r--r-- | locales/help_docs/zh-CN.yml | 4 | ||||
| -rw-r--r-- | src/utils/display.rs | 18 |
3 files changed, 22 insertions, 4 deletions
diff --git a/locales/help_docs/en.yml b/locales/help_docs/en.yml index 048cf09..a73bc54 100644 --- a/locales/help_docs/en.yml +++ b/locales/help_docs/en.yml @@ -875,14 +875,14 @@ jv: - Lost: %{path} moved_item: | - > Moved: Remote %{from} + \> Moved: Remote %{from} Local %{to} erased_item: | & Erased: %{path} modified_item: | - * Modified: %{path} + \* Modified: %{path} invalid_modified_item: | x Modified: %{path} (%{reason}) diff --git a/locales/help_docs/zh-CN.yml b/locales/help_docs/zh-CN.yml index fd83ca7..452b497 100644 --- a/locales/help_docs/zh-CN.yml +++ b/locales/help_docs/zh-CN.yml @@ -867,14 +867,14 @@ jv: - 丢失: %{path} moved_item: | - > 移动:远程 %{from} + \> 移动:远程 %{from} 本地 %{to} erased_item: | & 擦除: %{path} modified_item: | - * 修改: %{path} + \* 修改: %{path} invalid_modified_item: | x 修改: %{path}(%{reason}) diff --git a/src/utils/display.rs b/src/utils/display.rs index ca1f3b5..4610f4f 100644 --- a/src/utils/display.rs +++ b/src/utils/display.rs @@ -176,6 +176,24 @@ pub fn md(text: impl AsRef<str>) -> String { let chars: Vec<char> = text.chars().collect(); while i < chars.len() { + // Check for escape character \ + if chars[i] == '\\' && i + 1 < chars.len() { + let escaped_char = chars[i + 1]; + // Only escape specific characters + if matches!(escaped_char, '*' | '<' | '>' | '`') { + let mut escaped_text = escaped_char.to_string(); + + // Apply current color stack + for color in color_stack.iter().rev() { + escaped_text = apply_color(&escaped_text, color); + } + + result.push_str(&escaped_text); + i += 2; + continue; + } + } + // Check for color tag start [[color]] if i + 1 < chars.len() && chars[i] == '[' && chars[i + 1] == '[' { let mut j = i + 2; |
