fix css url regexp

This commit is contained in:
Yanzhen Yu
2018-11-23 22:57:22 +08:00
parent 9de02491fb
commit 124959a67d
2 changed files with 13 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ function extractOrigin(url: string): string {
return origin;
}
const URL_IN_CSS_REF = /url\((['"])([^'"]*)\1\)/gm;
const URL_IN_CSS_REF = /url\((['"]|)([^'"]*)\1\)/gm;
export function absoluteToStylesheet(cssText: string, href: string): string {
return cssText.replace(URL_IN_CSS_REF, (_1, _2, filePath) => {
if (!/^[./]/.test(filePath)) {