File tree Expand file tree Collapse file tree 6 files changed +116
-11
lines changed Expand file tree Collapse file tree 6 files changed +116
-11
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
3
## Unreleased
4
+ - feat(queries): Extract ` html_tags ` rules
4
5
- feat(queries): Extract ` ecma ` rules
5
6
6
7
## 0.12.165 - 2024-03-31
Original file line number Diff line number Diff line change 1
- (tag_name) @tag
2
- (erroneous_end_tag_name) @tag.error
1
+ ;; inherits: html_tags
2
+
3
3
(doctype) @constant
4
- (attribute_name) @attribute
5
- (attribute_value) @string
6
- (comment) @comment
7
4
8
- "<" @punctuation.bracket
9
- ">" @punctuation.bracket
10
- "</" @punctuation.bracket
5
+ "<! " @tag.delimiter
6
+
7
+ (entity) @character.special
Original file line number Diff line number Diff line change
1
+ (tag_name) @tag
2
+
3
+ ; (erroneous_end_tag_name) @error ; we do not lint syntax errors
4
+ (comment) @comment @spell
5
+
6
+ (attribute_name) @tag.attribute
7
+
8
+ ((attribute
9
+ (quoted_attribute_value) @string )
10
+ (#set! "priority" 99))
11
+
12
+ (text) @none @spell
13
+
14
+ ((element
15
+ (start_tag
16
+ (tag_name) @_tag )
17
+ (text) @markup.heading )
18
+ (#eq? @_tag "title"))
19
+
20
+ ((element
21
+ (start_tag
22
+ (tag_name) @_tag )
23
+ (text) @markup.heading. 1)
24
+ (#eq? @_tag "h1"))
25
+
26
+ ((element
27
+ (start_tag
28
+ (tag_name) @_tag )
29
+ (text) @markup.heading. 2)
30
+ (#eq? @_tag "h2"))
31
+
32
+ ((element
33
+ (start_tag
34
+ (tag_name) @_tag )
35
+ (text) @markup.heading. 3)
36
+ (#eq? @_tag "h3"))
37
+
38
+ ((element
39
+ (start_tag
40
+ (tag_name) @_tag )
41
+ (text) @markup.heading. 4)
42
+ (#eq? @_tag "h4"))
43
+
44
+ ((element
45
+ (start_tag
46
+ (tag_name) @_tag )
47
+ (text) @markup.heading. 5)
48
+ (#eq? @_tag "h5"))
49
+
50
+ ((element
51
+ (start_tag
52
+ (tag_name) @_tag )
53
+ (text) @markup.heading. 6)
54
+ (#eq? @_tag "h6"))
55
+
56
+ ((element
57
+ (start_tag
58
+ (tag_name) @_tag )
59
+ (text) @markup.strong )
60
+ (#any-of? @_tag "strong" "b"))
61
+
62
+ ((element
63
+ (start_tag
64
+ (tag_name) @_tag )
65
+ (text) @markup.italic )
66
+ (#any-of? @_tag "em" "i"))
67
+
68
+ ((element
69
+ (start_tag
70
+ (tag_name) @_tag )
71
+ (text) @markup.strikethrough )
72
+ (#any-of? @_tag "s" "del"))
73
+
74
+ ((element
75
+ (start_tag
76
+ (tag_name) @_tag )
77
+ (text) @markup.underline )
78
+ (#eq? @_tag "u"))
79
+
80
+ ((element
81
+ (start_tag
82
+ (tag_name) @_tag )
83
+ (text) @markup.raw )
84
+ (#any-of? @_tag "code" "kbd"))
85
+
86
+ ((element
87
+ (start_tag
88
+ (tag_name) @_tag )
89
+ (text) @string.special.url )
90
+ (#eq? @_tag "a"))
91
+
92
+ ((attribute
93
+ (attribute_name) @_attr
94
+ (quoted_attribute_value
95
+ (attribute_value) @string.special.url ))
96
+ (#any-of? @_attr "href" "src"))
97
+
98
+ [
99
+ "<"
100
+ ">"
101
+ "</"
102
+ "/>"
103
+ ] @tag.delimiter
104
+
105
+ "=" @operator
Original file line number Diff line number Diff line change 1
- ; inherits: html_tags
1
+ ;; inherits: html_tags
2
2
(raw_text_expr) @none
3
3
4
4
[
Original file line number Diff line number Diff line change 20
20
(require 'subr-x ))
21
21
22
22
(defvar tree-sitter-langs-tests-ignore-queries
23
- '( psv tsv ecma)
23
+ '( psv tsv ecma html_tags )
24
24
" List of queries to ignore the test." )
25
25
26
26
(defun tree-sitter-langs-tests-check-queries (lang-symbol )
Original file line number Diff line number Diff line change @@ -248,10 +248,12 @@ Return nil if there are no bundled patterns."
248
248
(dolist (sym (cons lang-symbol
249
249
(pcase lang-symbol
250
250
('arduino '(cpp c))
251
- ('astro '(html))
251
+ ('astro '(html_tags html))
252
252
('cpp '(c))
253
253
('csv '(tsv))
254
254
('hlsl '(cpp c))
255
+ ('html '(html_tags))
256
+ ('svelte '(html_tags))
255
257
('javascript '(ecma))
256
258
('typescript '(ecma))
257
259
('tsx '(ecma typescript))
You can’t perform that action at this time.
0 commit comments