Skip to content

fix: unescape HTML entities in tokenized code blocks#85

Merged
davi0015 merged 1 commit into
mainfrom
fix/codeblock-html-escape
Jul 10, 2026
Merged

fix: unescape HTML entities in tokenized code blocks#85
davi0015 merged 1 commit into
mainfrom
fix/codeblock-html-escape

Conversation

@davi0015

Copy link
Copy Markdown
Owner

parseTokenizedHtml extracted span text from VS Code's tokenizeToString output without decoding HTML entities. The tokenizer escapes <, >, & to <, >, & via strings.escape(), so code blocks showed literal '<' instead of '<' after tokenization completed.

Added unescapeHtml() — the exact inverse of strings.escape() (3 entities, & decoded last to handle literal '&' in source code correctly). Applied at span text extraction time.

parseTokenizedHtml extracted span text from VS Code's tokenizeToString
output without decoding HTML entities. The tokenizer escapes <, >, & to
&lt;, &gt;, &amp; via strings.escape(), so code blocks showed literal
'&lt;' instead of '<' after tokenization completed.

Added unescapeHtml() — the exact inverse of strings.escape() (3
entities, &amp; decoded last to handle literal '&amp;' in source code
correctly). Applied at span text extraction time.
@davi0015
davi0015 merged commit 5433a1d into main Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant