close #38, update data uri regexp

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 40d754884a
commit 6852da5fe5
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,