File tree Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Expand file tree Collapse file tree 1 file changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,9 @@ module.exports = function postHTMLExpressions (options) {
152152 unescapeDelimitersReplace = new RegExp ( `@${ delimitersSettings [ 0 ] . text [ 0 ] } ` , 'g' )
153153
154154 // kick off the parsing
155- return walk . bind ( null , { locals : options . locals } )
155+ return function ( tree ) {
156+ return clearRawTag ( walk ( { locals : options . locals } , tree ) )
157+ }
156158}
157159
158160function walk ( opts , nodes ) {
@@ -170,10 +172,10 @@ function walk (opts, nodes) {
170172
171173 // don't parse ignoredTag
172174 if ( node . tag === ignored ) {
173- node . tag = false
175+ // node.tag = false
174176
175177 m . push ( node )
176-
178+
177179 return m
178180 }
179181
@@ -396,3 +398,22 @@ function walk (opts, nodes) {
396398 return m
397399 } , [ ] )
398400}
401+
402+
403+ function clearRawTag ( tree ) {
404+
405+ return tree . reduce ( ( m , node ) => {
406+ if ( node . content ) {
407+ node . content = clearRawTag ( node . content )
408+ }
409+
410+ if ( node . tag === ignored ) {
411+ node . tag = false
412+ }
413+
414+ m . push ( node )
415+
416+ return m
417+ } , [ ] )
418+
419+ }
You can’t perform that action at this time.
0 commit comments