File tree 6 files changed +219
-181
lines changed
6 files changed +219
-181
lines changed Original file line number Diff line number Diff line change 27
27
'punctuation' : / \| $ /
28
28
}
29
29
} ,
30
- 'attribute ' : {
30
+ 'attr-name ' : {
31
31
pattern : / ^ ( \s * ) [ - \w \xA0 - \uFFFF ] + / ,
32
32
lookbehind : true
33
33
} ,
34
- 'value' : [
34
+ 'attr- value' : [
35
35
string ,
36
36
{
37
37
pattern : / ( = \s * ) [ - \w \xA0 - \uFFFF ] + (? = \s * $ ) / ,
55
55
lookbehind : true
56
56
}
57
57
] ,
58
- 'punctuation' : / [ ( ) ] /
58
+ 'combinator' : / > | \+ | ~ | \| \| / ,
59
+
60
+ // the `tag` token has been existed and removed.
61
+ // because we can't find a perfect tokenize to match it.
62
+ // if you want to add it, please read https://github.com/PrismJS/prism/pull/2373 first.
63
+
64
+ 'punctuation' : / [ ( ) , ] / ,
59
65
}
60
66
} ;
61
67
Original file line number Diff line number Diff line change 28
28
["selector", [
29
29
["attribute", [
30
30
["punctuation", "["],
31
- ["attribute ", "attr"],
31
+ ["attr-name ", "attr"],
32
32
["punctuation", "]"]
33
33
]]
34
34
]],
38
38
["selector", [
39
39
["attribute", [
40
40
["punctuation", "["],
41
- ["attribute ", "attr"],
41
+ ["attr-name ", "attr"],
42
42
["operator", "="],
43
- ["value", "val"],
43
+ ["attr- value", "val"],
44
44
["punctuation", "]"]
45
45
]]
46
46
]],
50
50
["selector", [
51
51
["attribute", [
52
52
["punctuation", "["],
53
- ["attribute ", "attr"],
53
+ ["attr-name ", "attr"],
54
54
["operator", "="],
55
- ["value", "\"val\""],
55
+ ["attr- value", "\"val\""],
56
56
["punctuation", "]"]
57
57
]]
58
58
]],
62
62
["selector", [
63
63
["attribute", [
64
64
["punctuation", "["],
65
- ["attribute ", "attr"],
65
+ ["attr-name ", "attr"],
66
66
["operator", "="],
67
- ["value", "'val'"],
67
+ ["attr- value", "'val'"],
68
68
["punctuation", "]"]
69
69
]]
70
70
]],
74
74
["selector", [
75
75
["attribute", [
76
76
["punctuation", "["],
77
- ["attribute ", "attr"],
77
+ ["attr-name ", "attr"],
78
78
["operator", "|="],
79
- ["value", "val"],
79
+ ["attr- value", "val"],
80
80
["punctuation", "]"]
81
81
]]
82
82
]],
86
86
["selector", [
87
87
["attribute", [
88
88
["punctuation", "["],
89
- ["attribute ", "attr"],
89
+ ["attr-name ", "attr"],
90
90
["operator", "~="],
91
- ["value", "val"],
91
+ ["attr- value", "val"],
92
92
["punctuation", "]"]
93
93
]]
94
94
]],
98
98
["selector", [
99
99
["attribute", [
100
100
["punctuation", "["],
101
- ["attribute ", "attr"],
101
+ ["attr-name ", "attr"],
102
102
["operator", "|="],
103
- ["value", "val"],
103
+ ["attr- value", "val"],
104
104
["punctuation", "]"]
105
105
]]
106
106
]],
110
110
["selector", [
111
111
["attribute", [
112
112
["punctuation", "["],
113
- ["attribute ", "attr"],
113
+ ["attr-name ", "attr"],
114
114
["operator", "^="],
115
- ["value", "val"],
115
+ ["attr- value", "val"],
116
116
["punctuation", "]"]
117
117
]]
118
118
]],
122
122
["selector", [
123
123
["attribute", [
124
124
["punctuation", "["],
125
- ["attribute ", "attr"],
125
+ ["attr-name ", "attr"],
126
126
["operator", "$="],
127
- ["value", "val"],
127
+ ["attr- value", "val"],
128
128
["punctuation", "]"]
129
129
]]
130
130
]],
134
134
["selector", [
135
135
["attribute", [
136
136
["punctuation", "["],
137
- ["attribute ", "attr"],
137
+ ["attr-name ", "attr"],
138
138
["operator", "*="],
139
- ["value", "val"],
139
+ ["attr- value", "val"],
140
140
["punctuation", "]"]
141
141
]]
142
142
]],
150
150
"foo",
151
151
["punctuation", "|"]
152
152
]],
153
- ["attribute ", "attr"],
153
+ ["attr-name ", "attr"],
154
154
["punctuation", "]"]
155
155
]],
156
156
["attribute", [
159
159
"*",
160
160
["punctuation", "|"]
161
161
]],
162
- ["attribute ", "attr"],
162
+ ["attr-name ", "attr"],
163
163
["punctuation", "]"]
164
164
]],
165
165
["attribute", [
166
166
["punctuation", "["],
167
167
["namespace", [
168
168
["punctuation", "|"]
169
169
]],
170
- ["attribute ", "attr"],
170
+ ["attr-name ", "attr"],
171
171
["punctuation", "]"]
172
172
]]
173
173
]],
181
181
"foo",
182
182
["punctuation", "|"]
183
183
]],
184
- ["attribute ", "attr"],
184
+ ["attr-name ", "attr"],
185
185
["operator", "|="],
186
- ["value", "val"],
186
+ ["attr- value", "val"],
187
187
["punctuation", "]"]
188
188
]]
189
189
]],
193
193
["selector", [
194
194
["attribute", [
195
195
["punctuation", "["],
196
- ["attribute ", "attr"],
196
+ ["attr-name ", "attr"],
197
197
["operator", "="],
198
- ["value", "val"],
198
+ ["attr- value", "val"],
199
199
["case-sensitivity", "i"],
200
200
["punctuation", "]"]
201
201
]]
206
206
["selector", [
207
207
["attribute", [
208
208
["punctuation", "["],
209
- ["attribute ", "attr"],
209
+ ["attr-name ", "attr"],
210
210
["operator", "="],
211
- ["value", "\"val\""],
211
+ ["attr- value", "\"val\""],
212
212
["case-sensitivity", "S"],
213
213
["punctuation", "]"]
214
214
]]
219
219
["selector", [
220
220
["attribute", [
221
221
["punctuation", "["],
222
- ["attribute ", "attr"],
222
+ ["attr-name ", "attr"],
223
223
["punctuation", "]"]
224
224
]]
225
225
]],
229
229
["selector", [
230
230
["attribute", [
231
231
["punctuation", "["],
232
- ["attribute ", "attr"],
232
+ ["attr-name ", "attr"],
233
233
["operator", "="],
234
- ["value", "val"],
234
+ ["attr- value", "val"],
235
235
["punctuation", "]"]
236
236
]]
237
237
]],
241
241
["selector", [
242
242
["attribute", [
243
243
["punctuation", "["],
244
- ["attribute ", "attr"],
244
+ ["attr-name ", "attr"],
245
245
["operator", "="],
246
- ["value", "val"],
246
+ ["attr- value", "val"],
247
247
["case-sensitivity", "i"],
248
248
["punctuation", "]"]
249
249
]]
254
254
["selector", [
255
255
["attribute", [
256
256
["punctuation", "["],
257
- ["attribute ", "attr"],
257
+ ["attr-name ", "attr"],
258
258
["operator", "="],
259
- ["value", "\"i#m :not(a.class)\""],
259
+ ["attr- value", "\"i#m :not(a.class)\""],
260
260
["punctuation", "]"]
261
261
]]
262
262
]],
Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ foo#bar {
7
7
8
8
#foo > .bar:hover:after {
9
9
10
+ span,
11
+ div {
12
+
13
+ div > p,
14
+ .css-li ~ .css-li,
15
+ .previous-selector + .selector,
16
+ .selected || td {
17
+
10
18
----------------------------------------------------
11
19
12
20
[
@@ -32,10 +40,34 @@ foo#bar {
32
40
33
41
["selector", [
34
42
["id", "#foo"],
35
- " > " ,
43
+ ["combinator", ">"] ,
36
44
["class", ".bar"],
37
45
["pseudo-class", ":hover"],
38
46
["pseudo-element", ":after"]
47
+ ]], ["punctuation", "{"],
48
+
49
+ ["selector", [
50
+ "span",
51
+ ["punctuation", ","],
52
+ "\r\ndiv"
53
+ ]], ["punctuation", "{"],
54
+
55
+ ["selector", [
56
+ "div ",
57
+ ["combinator", ">"],
58
+ " p",
59
+ ["punctuation", ","],
60
+ ["class", ".css-li"],
61
+ ["combinator", "~"],
62
+ ["class", ".css-li"],
63
+ ["punctuation", ","],
64
+ ["class", ".previous-selector"],
65
+ ["combinator", "+"],
66
+ ["class", ".selector"],
67
+ ["punctuation", ","],
68
+ ["class", ".selected"],
69
+ ["combinator", "||"],
70
+ " td"
39
71
]], ["punctuation", "{"]
40
72
]
41
73
You can’t perform that action at this time.
0 commit comments