Allow for newer Google Fonts import snippet (#186)

Google Fonts now supplies an HTTPS rather than HTTP URL in its snippet, and adds quotes around the URL string. This change allows such snippets to survive the sanitation process.
pull/249/head
Damian Cugley 6 years ago committed by Ian Prest
parent 721011f8fd
commit 31ef5a328d

@ -256,7 +256,7 @@ var $renderKey = (typeof(exports) !== 'undefined') ? exports : {};
css += "}\n";
} else {
var ok = (rule.name === "@font-face")
|| (rule.name === "@import" && !rule.content && rule.selector.match(/^url\(http:\/\/fonts.googleapis.com\/css\?family=[^\)]+\)$/));
|| (rule.name === "@import" && !rule.content && rule.selector.match(/^url\('?https?:\/\/fonts.googleapis.com\/css\?family=[^\)]+'?\)$/));
if(ok) {
css += rule.name;
if(rule.selector) css += ' ' + rule.selector;

Loading…
Cancel
Save