fix(compiler): REVERT allow absolute style urls (#14365)
This reverts commit 6b9aa2ca3d
.
This commit is contained in:
parent
1ece7366c8
commit
b565301186
|
@ -16,7 +16,7 @@ export class StyleWithImports {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function isStyleUrlResolvable(url: string): boolean {
|
export function isStyleUrlResolvable(url: string): boolean {
|
||||||
if (!url) return false;
|
if (url == null || url.length === 0 || url[0] == '/') return false;
|
||||||
const schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);
|
const schemeMatch = url.match(URL_WITH_SCHEMA_REGEXP);
|
||||||
return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';
|
return schemeMatch === null || schemeMatch[1] == 'package' || schemeMatch[1] == 'asset';
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,9 +110,9 @@ export function main() {
|
||||||
it('should not resolve urls with other schema',
|
it('should not resolve urls with other schema',
|
||||||
() => { expect(isStyleUrlResolvable('http://otherurl')).toBe(false); });
|
() => { expect(isStyleUrlResolvable('http://otherurl')).toBe(false); });
|
||||||
|
|
||||||
it('should resolve urls with absolute paths', () => {
|
it('should not resolve urls with absolute paths', () => {
|
||||||
expect(isStyleUrlResolvable('/otherurl')).toBe(true);
|
expect(isStyleUrlResolvable('/otherurl')).toBe(false);
|
||||||
expect(isStyleUrlResolvable('//otherurl')).toBe(true);
|
expect(isStyleUrlResolvable('//otherurl')).toBe(false);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue