File tree Expand file tree Collapse file tree
packages/core/src/compiler Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,6 +168,22 @@ describe("compileTimingAttrs", () => {
168168 expect ( compiled ) . toContain ( 'id="hf-video-0"' ) ;
169169 expect ( compiled ) . toContain ( 'data-end="2"' ) ;
170170 } ) ;
171+
172+ it ( "preserves inert regions when compiled output is compiled again" , ( ) => {
173+ const html = [
174+ '<style>.hero::after { content: "$& $$ $` $\' <video>"; }</style>' ,
175+ '<script>const markup = "$& $$ $` $\' <audio>";</script>' ,
176+ '<video class="hero" src="a.mp4" data-start="0" data-duration="2">' ,
177+ ] . join ( "\n" ) ;
178+
179+ const first = compileTimingAttrs ( html ) . html ;
180+ const second = compileTimingAttrs ( first ) . html ;
181+
182+ expect ( second ) . toContain ( '<style>.hero::after { content: "$& $$ $` $\' <video>"; }</style>' ) ;
183+ expect ( second ) . toContain ( '<script>const markup = "$& $$ $` $\' <audio>";</script>' ) ;
184+ expect ( second ) . toContain ( 'data-end="2"' ) ;
185+ expect ( second ) . not . toContain ( "HFMASK" ) ;
186+ } ) ;
171187} ) ;
172188
173189describe ( "injectDurations" , ( ) => {
You can’t perform that action at this time.
0 commit comments