Skip to content

Commit 8540775

Browse files
committed
Don’t touch empty style tags (fixes GoogleChromeLabs#17)
1 parent c547cef commit 8540775

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/cqfill.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ function init() {
3232
});
3333

3434
function handleStyleTag(el: HTMLStyleElement) {
35+
// Don’t touch empty style tags.
36+
if (el.innerHTML.trim().length === 0) return;
3537
const newSrc = transpileStyleSheet(el.innerHTML);
3638
el.innerHTML = newSrc;
3739
}

0 commit comments

Comments
 (0)