-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RAWTEXT/RCDATA elements are closed inconsistently #19
Comments
So, ehh, why are you using obsolete elements anyway? It’s marked as “Non-conforming features” by the HTML spec: so humans shouldn’t use it. Of course, you’re right that it would be good to fix. |
welll, <xmp> is still pretty convenient despite being obsolete, since it's the only "normal" element which is parsed in rawtext mode |
it seems like this happens because the text node handler calls The result of this is: With the markdown:
(note: in both cases, the actual result (as displayed by a browser) is |
Here's the code i used to check the results of that:
|
So to repeat: you really should not use If you start working on a PR, I recommend basing it off of #17. |
Initial checklist
Affected packages and versions
7.2.3
Link to runnable example
No response
Steps to reproduce
Expected behavior
The output tree should contain:
xmp
(note: <xmp> is parsed in RAWTEXT mode, so tags/escapes aren't parsed inside it, and it only ends when the parser reaches
</xmp>
)Actual behavior
xmp
the <xmp> element is being closed by the </b> tag
This affects all elements whose contents are parsed as RAWTEXT/SCRIPT_DATA (<style>, <iframe>, <noembed>, <noframes>, <script>) or RCDATA (<title>, <textarea>)
This can be seen in remark/rehype (with allowDangerousHtml enabled), in cases like:
which renders as:
Affected runtime and version
node@18.0.0
Affected package manager and version
npm@8.6.0
Affected OS and version
Debian
Build and bundle tools
Rollup
The text was updated successfully, but these errors were encountered: