From de0c74c4ceb258bcbba3af49ddc5f4a254f1654b Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 15 May 2024 13:44:55 +0100 Subject: [PATCH 1/3] Fix that the `.replace()` function only replaces the first occurrence --- packages/rrweb-snapshot/src/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/rrweb-snapshot/src/utils.ts b/packages/rrweb-snapshot/src/utils.ts index 5ccc9082ed..97094b40e8 100644 --- a/packages/rrweb-snapshot/src/utils.ts +++ b/packages/rrweb-snapshot/src/utils.ts @@ -47,7 +47,7 @@ function fixBrowserCompatibilityIssuesInCSS(cssText: string): string { !cssText.includes(' -webkit-background-clip: text;') ) { cssText = cssText.replace( - ' background-clip: text;', + /\sbackground-clip:\s*text;/g, ' -webkit-background-clip: text; background-clip: text;', ); } From d0482d58aab445b809fc238b200288652c8d7bc7 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 15 May 2024 13:45:34 +0100 Subject: [PATCH 2/3] This should have been included in #1174 --- .../test/__snapshots__/integration.test.ts.snap | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap b/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap index f537fc7b29..39c8c49ee1 100644 --- a/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap +++ b/packages/rrweb-snapshot/test/__snapshots__/integration.test.ts.snap @@ -364,6 +364,12 @@ exports[`integration tests [html file]: picture-in-frame.html 1`] = ` " `; +exports[`integration tests [html file]: picture-with-inline-onload.html 1`] = ` +" + \\"This + " +`; + exports[`integration tests [html file]: preload.html 1`] = ` " From 8032a92623c869817a9dfebde9ae94ff3a36f739 Mon Sep 17 00:00:00 2001 From: Eoghan Murray Date: Wed, 15 May 2024 14:40:44 +0100 Subject: [PATCH 3/3] Create fast-pets-exist.md --- .changeset/fast-pets-exist.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/fast-pets-exist.md diff --git a/.changeset/fast-pets-exist.md b/.changeset/fast-pets-exist.md new file mode 100644 index 0000000000..82d5216379 --- /dev/null +++ b/.changeset/fast-pets-exist.md @@ -0,0 +1,6 @@ +--- +"rrweb-snapshot": patch +"rrweb": patch +--- + +Fixup for multiple background-clip replacement