lezer-parser/xml

tokenizing of comment, cdata content error

Closed this issue · 2 comments

aptxx commented

hello,

it seems there is a issue in the tokens.js scanTo

if there is a character same with the end tag token, the end tag is not detected.
case1: "]" before CDATA end tag "]]>"
case2: "-" before comment end tag "-->"

export const commentContent = scanTo(_commentContent, "-->")
export const piContent = scanTo(_piContent, "?>")
export const cdataContent = scanTo(_cdataContent, "]]>")
WeChat94b45144f3fb76a4e9397debb5d6e572

Thanks for spotting that. Attached patch should help.

aptxx commented

that's cool. it's fixed