tokenizing of comment, cdata content error #4

Closed
opened 2023-10-26 08:48:24 +02:00 by aptxx · 2 comments
aptxx commented 2023-10-26 08:48:24 +02:00 (Migrated from github.com)

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
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, "]]>") ``` <img width="1406" alt="WeChat94b45144f3fb76a4e9397debb5d6e572" src="https://github.com/lezer-parser/xml/assets/2224883/f5624d80-3ca8-4c93-b717-e1b8744cef01">
marijnh commented 2023-10-26 11:08:12 +02:00 (Migrated from github.com)

Thanks for spotting that. Attached patch should help.

Thanks for spotting that. Attached patch should help.
aptxx commented 2023-10-26 19:41:24 +02:00 (Migrated from github.com)

that's cool. it's fixed

that's cool. it's fixed
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lezer/xml#4
No description provided.