Skip to content

Unrelated closing tags in script blocks interpreted as closing tags #2

Description

@ehoogeveen-medweb

Hi! I was trying out the lexer and I noticed that this block:

<script>"<style></style>"</script>

outputs the following sequence:

[ 'startTagStart', '<' ]
[ 'tagName', 'script' ]
[ 'tagEnd', '>' ]
[ 'rawtext', '"' ]
[ 'rawtext', '<style>' ]
[ 'endTagStart', '</' ]
[ 'tagName', 'style' ]
[ 'rawtext', '>"' ]
[ 'endTagStart', '</' ]
[ 'tagName', 'script' ]
[ 'tagEnd', '>' ]

As far as I know, the </style> should not be tokenized as an end tag because in a script block, the only valid end tag is </script> (not case sensitive and with optional whitespace between the /script and the >).

The readme mentions that script tags aren't fully handled, but I wasn't expecting this particular exception :) Is it expected behavior, given that the endTagStart and tagName are followed by a rawtext rather than a tagEnd and thus don't truly close the block?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions