Fixes HtmlParser handling of XML comments and values containing spaces#2619
Open
PowerfulBacon wants to merge 4 commits into
Open
Conversation
Contributor
Author
PowerfulBacon
commented
Jun 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




The HTML parser currently expects closing tags to match opening tags. This is a problem with comment nodes, as it pushes
!--to the stack, and expects!--/>, while the closing tag for comments is actually-->.When a comment tag is encountered, the reader will totally ignore it and it won't be pushed to the formatted message at all. By default, the reader will read the entire comment tag
<!-- this text will be included -->, however if the comment tag contains the>symbol, it won't be fully captured so I addedSkipCommentto handle that scenario.The result is that the warnings in the console no longer occur when parsing HTML with comments.
(The empty nodes are new-line tags, which should probably be limited to a single one without
tags, but that's a different issue).
Also handling the situation that might break it nicely:
Since the chat uses a browser window anyway, this has no visible effect on the chat but it stops an error in the console and this might become more important for maptext parsing, which is where the custom HTML parsing will have the most impact I think.