Skip to content
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

markupRegexp doesn't parse comments properly if they contain a dash in the text #916

Closed
gtm-nayan opened this issue May 13, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@gtm-nayan
Copy link
Contributor

Describe the bug
Given a comment like <!-- svelte-xyz -->, the parser will incorrectly include a trailing -- in the textContent of the comment.

https://github.com/capricorn86/happy-dom/blob/07448050a759d55f220abbfe85951e9da7c1157c/packages/happy-dom/src/xml-parser/XMLParser.ts#LL14C1-L27C104

To Reproduce
Run MARKUP_REGEXP.exec("<!-- a-b -->"), third group will have a-b --

Expected behavior
The third group contains a-b

@gtm-nayan gtm-nayan added the bug Something isn't working label May 13, 2023
gtm-nayan added a commit to gtm-nayan/happy-dom that referenced this issue May 13, 2023
capricorn86 added a commit to gtm-nayan/happy-dom that referenced this issue May 13, 2023
…to parse comments including dash characters (-).
capricorn86 added a commit to gtm-nayan/happy-dom that referenced this issue May 13, 2023
…to parse comments including dash characters (-).
capricorn86 added a commit that referenced this issue May 13, 2023
#916@patch: Handle comments with dash in text.
@capricorn86
Copy link
Owner

Thank you for your contribution @gtm-nayan! 🌟

Your fix has been released.

You can read more about the release here:
https://github.com/capricorn86/happy-dom/releases/tag/v9.18.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants