mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
Fix escape check for escaped backslash
This commit is contained in:
parent
63cc877023
commit
ae01a5b3a2
1 changed files with 2 additions and 1 deletions
|
@ -447,8 +447,9 @@ fn unescape_quotes(s: &str) -> Cow<str> {
|
||||||
fn is_invalid_escape(txt: &str) -> bool {
|
fn is_invalid_escape(txt: &str) -> bool {
|
||||||
// odd number of \s not followed by an escapable character
|
// odd number of \s not followed by an escapable character
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref RE: Regex = Regex::new(r#"(^|[^\\])(\\\\)*\\([^":*_()]|$)"#).unwrap();
|
static ref RE: Regex = Regex::new(r#"(^|[^\\])(\\\\)*\\([^\\":*_()]|$)"#).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
RE.is_match(txt)
|
RE.is_match(txt)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue