File tree Expand file tree Collapse file tree 4 files changed +1258
-1
lines changed
tests/fixtures/parser/ast Expand file tree Collapse file tree 4 files changed +1258
-1
lines changed Original file line number Diff line number Diff line change @@ -260,12 +260,15 @@ type Block = {
260260
261261/** Extract <script> blocks */
262262function * extractBlocks ( code : string ) : IterableIterator < Block > {
263- const startTagOpenRe = / < ( s c r i p t | s t y l e ) ( [ \s > ] ) / giu
263+ const startTagOpenRe = / < ! - - [ \s \S ] * ? - - > | < ( s c r i p t | s t y l e ) ( [ \s > ] ) / giu
264264 const endScriptTagRe = / < \/ s c r i p t > / giu
265265 const endStyleTagRe = / < \/ s t y l e > / giu
266266 let startTagOpenMatch
267267 while ( ( startTagOpenMatch = startTagOpenRe . exec ( code ) ) ) {
268268 const [ , tag , nextChar ] = startTagOpenMatch
269+ if ( ! tag ) {
270+ continue
271+ }
269272 let startTagEnd = startTagOpenRe . lastIndex
270273
271274 let attrs : AttributeToken [ ] = [ ]
Original file line number Diff line number Diff line change 1+ <!-- <script> -->
2+ <script >
3+ let a = ' ' ;
4+ </script >
5+ <input type ="number" bind:value ={a }>
You can’t perform that action at this time.
0 commit comments