handle <br/> when rendering a single line

+ case-insensitive matching

https://forums.ankiweb.net/t/html-editor-modifies-note-when-a-field-with-break-tags-is-opened/10772
This commit is contained in:
Damien Elmes 2021-06-14 12:58:10 +10:00
parent a4dc8a0b82
commit 220fca9a1d

View File

@ -106,7 +106,7 @@ lazy_static! {
\[/anki:tts\] \[/anki:tts\]
"#).unwrap(); "#).unwrap();
static ref PERSISTENT_HTML_SPACERS: Regex = Regex::new("<br>|<br />|<div>|\n").unwrap(); static ref PERSISTENT_HTML_SPACERS: Regex = Regex::new(r#"(?i)<br\s*/?>|<div>|\n"#).unwrap();
static ref UNPRINTABLE_TAGS: Regex = Regex::new( static ref UNPRINTABLE_TAGS: Regex = Regex::new(
r"(?xs) r"(?xs)