close #38, update data uri regexp

This commit is contained in:
Yanzhen Yu
2020-11-21 11:05:08 +08:00
parent da182f4927
commit 555398d3f5
2 changed files with 28 additions and 16 deletions

View File

@@ -63,7 +63,7 @@ function extractOrigin(url: string): string {
const URL_IN_CSS_REF = /url\((?:(')([^']*)'|(")([^"]*)"|([^)]*))\)/gm;
const RELATIVE_PATH = /^(?!www\.|(?:http|ftp)s?:\/\/|[A-Za-z]:\\|\/\/).*/;
const DATA_URI = /^(data:)([\w\/\+\-]+);(charset=[\w-]+|base64|utf-?8).*,(.*)/i;
const DATA_URI = /^(data:)([^,]*),(.*)/i;
export function absoluteToStylesheet(
cssText: string | null,
href: string,