isaacs / sax-js

A sax style parser for JS
Other
1.09k stars 325 forks source link

<script>a = "</scr" + "ipt>";<script> is parsed incorrectly #229

Open spelchat opened 6 years ago

spelchat commented 6 years ago

The following test case fails:

require(__dirname).test({                                                                                                                                                                                           
  xml: '<script>a = "</scr" + "ipt>";</script>',                                                                                                                                                                    
  expect: [                                                                                                                                                                                                         
    ['opentagstart', {name: 'script', attributes: {}}],                                                                                                                                                             
    ['opentag', {name: 'script', attributes: {}, isSelfClosing: false}],                                                                                                                                            
    ['script', 'a = "</scr" + "ipt>";'],                                                                                                                                                                            
    ['closetag', 'script']                                                                                                                                                                                          
  ],                                                                                                                                                                                                                
  strict: false,                                                                                                                                                                                                    
  opt: {lowercasetags: true, noscript: false}                                                                                                                                                                       
})

I will send a pull request shortly.