mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
Don't escape isolated -
This commit is contained in:
parent
873e96b60a
commit
ecd04f8a59
1 changed files with 2 additions and 2 deletions
|
@ -60,7 +60,7 @@ fn escape(txt: &str) -> String {
|
|||
let txt = txt.replace("\"", "\\\"").replace(":", "\\:");
|
||||
if txt.chars().any(|c| " \u{3000}()".contains(c)) {
|
||||
format!(r#""{}""#, txt)
|
||||
} else if txt.starts_with('-') {
|
||||
} else if txt.len() > 1 && txt.starts_with('-') {
|
||||
format!("\\{}", txt)
|
||||
} else {
|
||||
txt
|
||||
|
@ -82,7 +82,7 @@ fn write_single_field(field: &str, text: &str, is_re: bool) -> String {
|
|||
let txt = format!("{}:{}{}", field, re, text).replace("\"", "\\\"");
|
||||
if txt.chars().any(|c| " \u{3000}()".contains(c)) {
|
||||
format!(r#""{}""#, txt)
|
||||
} else if txt.starts_with('-') {
|
||||
} else if txt.len() > 1 && txt.starts_with('-') {
|
||||
format!("\\{}", txt)
|
||||
} else {
|
||||
txt
|
||||
|
|
Loading…
Reference in a new issue