diff --git a/.changeset/modern-doors-watch.md b/.changeset/modern-doors-watch.md index b74bfbad45..7419ccb0de 100644 --- a/.changeset/modern-doors-watch.md +++ b/.changeset/modern-doors-watch.md @@ -1,5 +1,5 @@ --- -'rrweb-snapshot': patch +'@amplitude/rrweb-snapshot': patch --- better nested css selector splitting when commas or brackets happen to be in quoted text diff --git a/packages/rrweb-snapshot/src/css.ts b/packages/rrweb-snapshot/src/css.ts index 1a3157d40f..220e1a1fce 100644 --- a/packages/rrweb-snapshot/src/css.ts +++ b/packages/rrweb-snapshot/src/css.ts @@ -433,7 +433,7 @@ export function parse(css: string, options: ParserOptions = {}): Stylesheet { } // Use match logic from https://github.com/NxtChg/pieces/blob/3eb39c8287a97632e9347a24f333d52d916bc816/js/css_parser/css_parse.js#L46C1-L47C1 - const m = match(/^(("(?:\\"|[^"])*"|'(?:\\'|[^'])*'|[^{])+)/); + const m = match(/^(((? { const pos = position(); const m = match(re);