mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 13:00:08 -04:00
refactor: make html-like languages inherit from single query
This commit is contained in:
parent
801adf2377
commit
5d2faa0466
7 changed files with 61 additions and 119 deletions
|
|
@ -1,43 +1,5 @@
|
|||
(tag_name) @tag
|
||||
(erroneous_end_tag_name) @error
|
||||
; inherits: html_tags
|
||||
|
||||
(doctype) @constant
|
||||
(attribute_name) @property
|
||||
(attribute_value) @string
|
||||
(quoted_attribute_value) @string
|
||||
(comment) @comment
|
||||
|
||||
((element (start_tag (tag_name) @_tag) (text) @text.title)
|
||||
(#match? @_tag "^(h[0-9]|title)$"))
|
||||
|
||||
((element (start_tag (tag_name) @_tag) (text) @text.strong)
|
||||
(#match? @_tag "^(strong|b)$"))
|
||||
|
||||
((element (start_tag (tag_name) @_tag) (text) @text.emphasis)
|
||||
(#match? @_tag "^(em|i)$"))
|
||||
|
||||
((element (start_tag (tag_name) @_tag) (text) @text.strike)
|
||||
(#match? @_tag "^(s|del)$"))
|
||||
|
||||
((element (start_tag (tag_name) @_tag) (text) @text.underline)
|
||||
(#eq? @_tag "u"))
|
||||
|
||||
((element (start_tag (tag_name) @_tag) (text) @text.literal)
|
||||
(#match? @_tag "^(code|kbd)$"))
|
||||
|
||||
((element (start_tag (tag_name) @_tag) (text) @text.uri)
|
||||
(#eq? @_tag "a"))
|
||||
|
||||
((attribute
|
||||
(attribute_name) @_attr
|
||||
(quoted_attribute_value (attribute_value) @text.uri))
|
||||
(#match? @_attr "^(href|src)$"))
|
||||
|
||||
"=" @operator
|
||||
|
||||
[
|
||||
"<"
|
||||
"<!"
|
||||
">"
|
||||
"</"
|
||||
"/>"
|
||||
] @tag.delimiter
|
||||
"<!" @tag.delimiter
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue