File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ Vue.config.debug = true
42
42
}
43
43
</style >
44
44
<script >
45
+ let a= 1 < 2 ;
45
46
console .log (" ***This script tag is successfully extracted and excuted.***" )
46
47
module .exports = {
47
48
components: {
@@ -63,7 +64,7 @@ Vue.config.debug = true
63
64
}
64
65
}
65
66
</script >
66
-
67
+ jjjjjjjjjjjjjjjjjjjjjj
67
68
<template >
68
69
<div ></div >
69
70
</template >
Original file line number Diff line number Diff line change @@ -82,15 +82,17 @@ module.exports = function (source) {
82
82
83
83
//add ruler:extract script and style tags from html token content
84
84
parser . core . ruler . push ( 'extract_script_or_style' , function replace ( state ) {
85
- let tag_reg = new RegExp ( "<(script|style)[^<]* <\/\\1>" , 'g' ) ;
85
+ let tag_reg = new RegExp ( "<(script|style)(?: [^<]|<)+ <\/\\1>" , 'g' ) ;
86
86
let newTokens = [ ] ;
87
87
state . tokens . filter ( token => token . type == 'fence' && token . info == 'html' ) . forEach ( token => {
88
88
let tokens = ( token . content . match ( tag_reg ) || [ ] ) . map ( content => {
89
89
let t = new Token ( 'html_block' , '' , 0 ) ;
90
90
t . content = content ;
91
91
return t ;
92
92
} ) ;
93
- if ( tokens . length > 0 ) newTokens . push . apply ( newTokens , tokens ) ;
93
+ if ( tokens . length > 0 ) {
94
+ newTokens . push . apply ( newTokens , tokens ) ;
95
+ }
94
96
} )
95
97
state . tokens . push . apply ( state . tokens , newTokens ) ;
96
98
} ) ;
You can’t perform that action at this time.
0 commit comments