elm-xml-parser icon indicating copy to clipboard operation
elm-xml-parser copied to clipboard

Fix stack overflow with CData edge case

Open edwardsnjd opened this issue 6 years ago • 0 comments

Thanks for this great library!

I hit an issue when parsing CData content ending with a square bracket, ]:

<a>
  <![CDATA[ note extra sq bracket here ->]]]>
</a>

I added some tests for this case and had a go at making them all pass again. My understanding of the spec is that nothing is parsed inside the CData content so we can safely chomp until the end token: https://www.w3.org/TR/REC-xml/#sec-cdata-sect

I'm an elm newcomer and didn't fully understand the existing implementation, so would appreciate any input.

edwardsnjd avatar Aug 28 '19 15:08 edwardsnjd