html: Improve syntax highlighting (#28184)

| Zed 0.180.2 | With this PR |
| --- | --- |
|
![Image](https://github.com/user-attachments/assets/89d70ba1-791b-462e-9a14-31c75bcebb7e)
|
![Image](https://github.com/user-attachments/assets/9199499e-071e-49b3-8536-b04b8ce5a222)
|


```html
<script>
  return <div class="main content"></div>
</script>
<div class="main content"></div>
<span></spn>
```

Changes homogenize JSX and HTML

- `"`: `string`
- `=`: `operator` -> `punctuation.delimiter` like in
[JSX](3775496b84/crates/languages/src/javascript/highlights.scm (L246)),
[VSCode](336801752d/extensions/html/syntaxes/html.tmLanguage.json (L382))
- `erroneous_end_tag_name`: `keyword` -> not a keyword

Release Notes:

  - Improved HTML highlighting
This commit is contained in:
chbk 2025-04-17 19:40:56 +02:00 committed by GitHub
parent c21bca07e2
commit e4f692ac75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,11 +1,14 @@
(tag_name) @tag
(erroneous_end_tag_name) @keyword
(doctype) @tag.doctype
(attribute_name) @attribute
(attribute_value) @string
[
"\""
"'"
(attribute_value)
] @string
(comment) @comment
"=" @operator
"=" @punctuation.delimiter.html
[
"<"
@ -13,4 +16,4 @@
"<!"
"</"
"/>"
] @punctuation.bracket
] @punctuation.bracket.html