mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(superhtml): add superhtml parser and queries
SuperHTML is a templating language used by the zine static site generator.
This commit is contained in:
parent
da7e9751f1
commit
1bcdd79088
4 changed files with 66 additions and 0 deletions
|
|
@ -728,6 +728,9 @@
|
|||
"supercollider": {
|
||||
"revision": "1a8ee0da9a4f2df5a8a22f4d637ac863623a78a7"
|
||||
},
|
||||
"superhtml": {
|
||||
"revision": "3edb67236291d45ba97a79cdac3b91692487a352"
|
||||
},
|
||||
"surface": {
|
||||
"revision": "f4586b35ac8548667a9aaa4eae44456c1f43d032"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -2109,6 +2109,18 @@ list.supercollider = {
|
|||
maintainers = { "@madskjeldgaard" },
|
||||
}
|
||||
|
||||
list.superhtml = {
|
||||
install_info = {
|
||||
url = "https://github.com/kristoff-it/superhtml",
|
||||
files = {
|
||||
"src/parser.c",
|
||||
"src/scanner.c",
|
||||
},
|
||||
location = "tree-sitter-superhtml",
|
||||
},
|
||||
maintainers = { "@rockorager" },
|
||||
}
|
||||
|
||||
list.surface = {
|
||||
install_info = {
|
||||
url = "https://github.com/connorlay/tree-sitter-surface",
|
||||
|
|
|
|||
44
queries/superhtml/highlights.scm
Normal file
44
queries/superhtml/highlights.scm
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
(doctype) @constant
|
||||
|
||||
(comment) @comment
|
||||
|
||||
(tag_name) @tag
|
||||
|
||||
((tag_name) @string.special
|
||||
(#any-of? @string.special "super" "extend"))
|
||||
|
||||
(attribute_name) @attribute
|
||||
|
||||
(attribute_value) @string
|
||||
|
||||
((element
|
||||
(start_tag
|
||||
(attribute
|
||||
(attribute_name) @_attribute
|
||||
[
|
||||
(attribute_value) @markup.link.url
|
||||
(quoted_attribute_value
|
||||
(attribute_value) @markup.link.url)
|
||||
]))
|
||||
(element
|
||||
(start_tag
|
||||
(tag_name) @tag)))
|
||||
(#eq? @tag "super")
|
||||
(#eq? @_attribute "id"))
|
||||
|
||||
(element
|
||||
(start_tag
|
||||
(tag_name) @string.special)
|
||||
(#eq? @string.special "super"))
|
||||
|
||||
"\"" @string
|
||||
|
||||
[
|
||||
"<"
|
||||
">"
|
||||
"</"
|
||||
"/>"
|
||||
"<!"
|
||||
] @punctuation.bracket
|
||||
|
||||
"=" @punctuation.delimiter
|
||||
7
queries/superhtml/injections.scm
Normal file
7
queries/superhtml/injections.scm
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
((script_element
|
||||
(raw_text) @injection.content)
|
||||
(#set! injection.language "javascript"))
|
||||
|
||||
((style_element
|
||||
(raw_text) @injection.content)
|
||||
(#set! injection.language "css"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue