parent
b96784756c
commit
0def28e594
|
@ -88,7 +88,8 @@ export function normalizeCSS(css: string): string {
|
|||
css = StringWrapper.replaceAll(css, /:\s/g, ':');
|
||||
css = StringWrapper.replaceAll(css, /'/g, '"');
|
||||
css = StringWrapper.replaceAll(css, / }/g, '}');
|
||||
css = StringWrapper.replaceAllMapped(css, /url\(\"(.+)\\"\)/g, (match) => `url(${match[1]})`);
|
||||
css = StringWrapper.replaceAllMapped(css, /url\((\"|\s)(.+)(\"|\s)\)(\s*)/g,
|
||||
(match) => `url("${match[2]}")`);
|
||||
css = StringWrapper.replaceAllMapped(css, /\[(.+)=([^"\]]+)\]/g,
|
||||
(match) => `[${match[1]}="${match[2]}"]`);
|
||||
return css;
|
||||
|
|
|
@ -155,10 +155,14 @@ export function main() {
|
|||
expect(css).toEqual('x[a] y[a] {}');
|
||||
});
|
||||
|
||||
// TODO: can't work in Firefox, see https://bugzilla.mozilla.org/show_bug.cgi?id=625013
|
||||
// Issue opened to track that: https://github.com/angular/angular/issues/4628
|
||||
if (!browserDetection.isFirefox) {
|
||||
it('should pass through @import directives', () => {
|
||||
var styleStr = '@import url("https://fonts.googleapis.com/css?family=Roboto");';
|
||||
var css = s(styleStr, 'a');
|
||||
expect(css).toEqual(styleStr);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue