fix absolute to doc
This commit is contained in:
@@ -67,11 +67,7 @@ export function absoluteToStylesheet(cssText: string, href: string): string {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
const RELATIVE_PATH = /^(\.\.|\.|)\//;
|
|
||||||
function absoluteToDoc(doc: Document, attributeValue: string): string {
|
function absoluteToDoc(doc: Document, attributeValue: string): string {
|
||||||
if (!RELATIVE_PATH.test(attributeValue)) {
|
|
||||||
return attributeValue;
|
|
||||||
}
|
|
||||||
const a: HTMLAnchorElement = doc.createElement('a');
|
const a: HTMLAnchorElement = doc.createElement('a');
|
||||||
a.href = attributeValue;
|
a.href = attributeValue;
|
||||||
return a.href;
|
return a.href;
|
||||||
|
|||||||
Reference in New Issue
Block a user