File tree Expand file tree Collapse file tree 4 files changed +37
-3
lines changed Expand file tree Collapse file tree 4 files changed +37
-3
lines changed Original file line number Diff line number Diff line change @@ -151,4 +151,4 @@ EXTERNAL *netrw-externapp* {{{2
151
151
(uppercase_name)
152
152
(tag
153
153
(word))
154
- (ERROR )))))
154
+ (word )))))
Original file line number Diff line number Diff line change @@ -352,3 +352,30 @@ codeblock stop and start on same line
352
352
(codeblock
353
353
(line)
354
354
(line)))))
355
+
356
+ ================================================================================
357
+ NOT codeblock: whitespace after ">"
358
+ ================================================================================
359
+ x >
360
+ line
361
+
362
+ x x>
363
+ line
364
+
365
+
366
+
367
+ --------------------------------------------------------------------------------
368
+
369
+ (help_file
370
+ (block
371
+ (line
372
+ (word)
373
+ (word))
374
+ (line
375
+ (word)))
376
+ (block
377
+ (line
378
+ (word)
379
+ (word))
380
+ (line
381
+ (word))))
Original file line number Diff line number Diff line change @@ -82,6 +82,8 @@ module.exports = grammar({
82
82
'(' ,
83
83
/ \w + \( / ,
84
84
'~' ,
85
+ // NOT codeblock: random ">" in middle of the motherflippin text.
86
+ '>' ,
85
87
) ,
86
88
87
89
keycode : ( ) => choice (
@@ -121,7 +123,8 @@ module.exports = grammar({
121
123
122
124
// Codeblock: preformatted block of lines starting with ">".
123
125
codeblock : ( $ ) => prec . right ( seq (
124
- / > [ \t ] * \n / ,
126
+ '>' ,
127
+ token . immediate ( '\n' ) ,
125
128
repeat1 ( alias ( $ . line_code , $ . line ) ) ,
126
129
// Codeblock ends if a line starts with non-whitespace.
127
130
// Terminating "<" is consumed in other rules.
@@ -182,7 +185,7 @@ module.exports = grammar({
182
185
h3 : ( $ ) =>
183
186
seq (
184
187
field ( 'name' , $ . uppercase_name ) ,
185
- repeat ( $ . tag ) ,
188
+ optional ( seq ( $ . tag , repeat ( $ . _atom ) ) ) ,
186
189
'\n' ,
187
190
) ,
188
191
Original file line number Diff line number Diff line change 14
14
"`" @conceal (#set! conceal "")
15
15
text: (_) @text.literal )
16
16
(codeblock) @text.literal
17
+ (codeblock
18
+ ">" @conceal (#set! conceal ""))
19
+ (block
20
+ "<" @conceal (#set! conceal ""))
17
21
(argument) @parameter
18
22
(keycode) @string.special
19
23
(url) @text.uri
You can’t perform that action at this time.
0 commit comments