File tree 4 files changed +1258
-1
lines changed
tests/fixtures/parser/ast
4 files changed +1258
-1
lines changed Original file line number Diff line number Diff line change @@ -260,12 +260,15 @@ type Block = {
260
260
261
261
/** Extract <script> blocks */
262
262
function * 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
264
264
const endScriptTagRe = / < \/ s c r i p t > / giu
265
265
const endStyleTagRe = / < \/ s t y l e > / giu
266
266
let startTagOpenMatch
267
267
while ( ( startTagOpenMatch = startTagOpenRe . exec ( code ) ) ) {
268
268
const [ , tag , nextChar ] = startTagOpenMatch
269
+ if ( ! tag ) {
270
+ continue
271
+ }
269
272
let startTagEnd = startTagOpenRe . lastIndex
270
273
271
274
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