languages: Add syntax highlighting for HTML character references (#48629)

HTML character references like `·`, `'`, and `{` are
correctly parsed by tree-sitter as named nodes
(`html_character_reference` in TSX/JavaScript, `entity` in HTML), but no
highlight query captures them. This means they render as plain,
unhighlighted text in the editor.

This PR adds one-line highlight captures for each:

- **TSX** (`crates/languages/src/tsx/highlights.scm`):
`(html_character_reference) @string.special`
- **JavaScript** (`crates/languages/src/javascript/highlights.scm`):
`(html_character_reference) @string.special`
- **HTML** (`extensions/html/languages/html/highlights.scm`): `(entity)
@string.special`

`@string.special` is already styled by all built-in themes (One Dark,
Ayu, Gruvbox, etc.), so no theme changes are needed.

Release Notes:

- Added syntax highlighting for HTML character references (`·`,
`'`, `{`, etc.) in TSX, JavaScript, and HTML files.
This commit is contained in:
Brett Schneider 2026-02-22 22:40:18 -06:00 committed by GitHub
parent af20a870cc
commit d54a262436
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View file

@ -360,3 +360,4 @@
(jsx_self_closing_element (["<" "/>"]) @punctuation.bracket.jsx)
(jsx_attribute "=" @punctuation.delimiter.jsx)
(jsx_text) @text.jsx
(html_character_reference) @string.special

View file

@ -424,3 +424,4 @@
(jsx_self_closing_element (["<" "/>"]) @punctuation.bracket.jsx)
(jsx_attribute "=" @punctuation.delimiter.jsx)
(jsx_text) @text.jsx
(html_character_reference) @string.special

View file

@ -7,6 +7,7 @@
(attribute_value)
] @string
(comment) @comment
(entity) @string.special
"=" @punctuation.delimiter.html