diff --git a/src/lib/remap-html.test.ts b/src/lib/remap-html.test.ts index cf5bc16..38e0dca 100644 --- a/src/lib/remap-html.test.ts +++ b/src/lib/remap-html.test.ts @@ -44,6 +44,20 @@ test('remaps a single style block', () => { }) }) +test('remaps correctly when two style blocks have identical content', () => { + let css = `h1 { color: red; }` + // Two style tags with identical CSS — indexOf always finds the first occurrence, + // so a range inside the second block falls outside [first_start, first_end] and gets dropped + let html = `` + let second_start = html.lastIndexOf('