Skip to content

Commit fc1b022

Browse files
committed
fix: column_heading does not allow space after "~"
Example from ":help definitions": 2. bbb 2. bbb 2. bbb 10. ddd 3. ccc ccc ccc 3. ccc ccc ccc 3. ccc ccc c 11. ~
1 parent 33afae9 commit fc1b022

File tree

4 files changed

+18
-13
lines changed

4 files changed

+18
-13
lines changed

corpus/codespan.txt

+2-4
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ an error`.
4040
(word))
4141
(word)
4242
(word)
43-
(codespan
43+
(ERROR
4444
(word)
45-
(MISSING "`")))
46-
(line
47-
(word)
45+
(word))
4846
(word))))
4947

5048
================================================================================

corpus/heading3-column_heading.txt

+4
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ ABC not-h3
234234
NOT column_heading
235235
================================================================================
236236
tilde ~/foo/bar foo~ bar
237+
trailing-space-is-NOT-column_heading ~
237238

238239

239240
--------------------------------------------------------------------------------
@@ -243,5 +244,8 @@ tilde ~/foo/bar foo~ bar
243244
(line
244245
(word)
245246
(word)
247+
(word)
248+
(word))
249+
(line
246250
(word)
247251
(word))))

corpus/optionlink.txt

+11-5
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,13 @@ x `after_codespan`'s
9999
(ERROR)
100100
(block
101101
(line
102-
(codespan
102+
(argument
103103
(word))
104-
(ERROR))))
104+
(word))
105+
(ERROR
106+
(word)
107+
(codespan
108+
(word)))))
105109

106110
================================================================================
107111
NOT optionlink 3 (FIXME)
@@ -116,6 +120,8 @@ foo '"\ '. Notice
116120
(block
117121
(line
118122
(word)
119-
(word
120-
(ERROR)
121-
(MISSING "'")))))
123+
(ERROR)
124+
(word))
125+
(line
126+
(taglink
127+
(word)))))

grammar.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,7 @@ module.exports = grammar({
137137
// TODO: children should be $.word (plaintext), not $.atom.
138138
column_heading: ($) => seq(
139139
field('name', seq(choice($._atom_noli, $._uppercase_words), repeat($._atom))),
140-
choice(
141-
token.immediate(/~[\t ]*\n/),
142-
/~[\t ]*\n/,
143-
),
140+
/~\n/,
144141
),
145142

146143
h1: ($) =>

0 commit comments

Comments
 (0)