Ignore broken CSS (#15)

Broken CSS inside a page will throw an error on our behalf. This should
be ignored because we are not in control of the CSS on the page we are
recording.
This commit is contained in:
dphuang2
2026-04-01 12:00:00 +08:00
committed by yz-yu
parent ef0b4b403c
commit 939eddcca5

View File

@@ -58,7 +58,7 @@ function getTagName(n: elementNode): string {
const HOVER_SELECTOR = /([^\\]):hover/g;
export function addHoverClass(cssText: string): string {
const ast = parse(cssText);
const ast = parse(cssText, {silent: true});
if (!ast.stylesheet) {
return cssText;
}