aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLevi Frandsen <l3viop@gmail.com>2024-05-01 09:44:51 -0500
committerChristian Clason <c.clason@uni-graz.at>2024-05-01 17:15:55 +0200
commitbbc67f736e22c37c23f2c11a05bfa23b715af30c (patch)
tree88cb215c4b1d5c3cd715c19ab850fe8726709f78
parentfeat(latex, query, tablegen, thrift): disable spelling in shebangs (diff)
downloadnvim-treesitter-bbc67f736e22c37c23f2c11a05bfa23b715af30c.tar
nvim-treesitter-bbc67f736e22c37c23f2c11a05bfa23b715af30c.tar.gz
nvim-treesitter-bbc67f736e22c37c23f2c11a05bfa23b715af30c.tar.bz2
nvim-treesitter-bbc67f736e22c37c23f2c11a05bfa23b715af30c.tar.lz
nvim-treesitter-bbc67f736e22c37c23f2c11a05bfa23b715af30c.tar.xz
nvim-treesitter-bbc67f736e22c37c23f2c11a05bfa23b715af30c.tar.zst
nvim-treesitter-bbc67f736e22c37c23f2c11a05bfa23b715af30c.zip
fix(html_tags): stop indenting void elements
-rw-r--r--queries/html_tags/indents.scm14
1 files changed, 8 insertions, 6 deletions
diff --git a/queries/html_tags/indents.scm b/queries/html_tags/indents.scm
index 1eac15bfd..6fe984fa9 100644
--- a/queries/html_tags/indents.scm
+++ b/queries/html_tags/indents.scm
@@ -1,17 +1,19 @@
[
((element
(start_tag
- (tag_name) @_not_special))
- (#not-any-of? @_not_special "meta" "link"))
+ (tag_name) @_not_void_element))
+ (#not-any-of? @_not_void_element
+ "area" "base" "basefont" "bgsound" "br" "col" "command" "embed" "frame" "hr" "image" "img"
+ "input" "isindex" "keygen" "link" "menuitem" "meta" "nextid" "param" "source" "track" "wbr"))
(element
(self_closing_tag))
] @indent.begin
-; These tags are usually written one-lined and doesn't use self-closing tags so special-cased them
-; but add indent to the tag to make sure attributes inside them are still indented if written multi-lined
((start_tag
- (tag_name) @_special)
- (#any-of? @_special "meta" "link")) @indent.begin
+ (tag_name) @_void_element)
+ (#any-of? @_void_element
+ "area" "base" "basefont" "bgsound" "br" "col" "command" "embed" "frame" "hr" "image" "img"
+ "input" "isindex" "keygen" "link" "menuitem" "meta" "nextid" "param" "source" "track" "wbr")) @indent.begin
; These are the nodes that will be captured when we do `normal o`
; But last element has already been ended, so capturing this