mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix issue in regex for underscored CSS imports (#3728)
* Use lazy quantifier in UNDERSCORED_CSS_IMPORTS regex * Add test
This commit is contained in:
parent
c35237c94d
commit
3acca96ed8
1 changed files with 11 additions and 2 deletions
|
@ -186,7 +186,7 @@ static UNDERSCORED_CSS_IMPORTS: LazyLock<Regex> = LazyLock::new(|| {
|
|||
| # or
|
||||
'(_[^']+)' # single quoted
|
||||
| # or
|
||||
(_.+) # unquoted filename
|
||||
(_.+?) # unquoted filename
|
||||
\s*\))
|
||||
"#,
|
||||
)
|
||||
|
@ -649,8 +649,17 @@ mod test {
|
|||
"URL(\"_bar.css\")\n",
|
||||
"@import url('_baz.css')\n",
|
||||
"url('nope.css')\n",
|
||||
"url(_foo.woff2) format('woff2')",
|
||||
)),
|
||||
vec!["_foo.css", "_bar.css", "_baz.css", "_foo.css", "_bar.css", "_baz.css",]
|
||||
vec![
|
||||
"_foo.css",
|
||||
"_bar.css",
|
||||
"_baz.css",
|
||||
"_foo.css",
|
||||
"_bar.css",
|
||||
"_baz.css",
|
||||
"_foo.woff2"
|
||||
]
|
||||
);
|
||||
assert_eq!(
|
||||
extract_underscored_references(concat!(
|
||||
|
|
Loading…
Reference in a new issue