Skip to content

Commit b2972cf

Browse files
committed
fix: single | parsed as (taglink) error
fix #30 fix #23
1 parent e074025 commit b2972cf

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

corpus/taglink.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ taglink in parentheses
7070
================================================================================
7171
NOT a taglink
7272
================================================================================
73-
7473
whitespace |world foo bar|
74+
|
75+
rx |
76+
rx | ry
7577
adjacent || |||
7678
table-borders |=========| |---------|
7779

@@ -93,6 +95,16 @@ Note: ":autocmd" can...
9395
(MISSING "|"))
9496
(word)
9597
(word))
98+
(line
99+
(word
100+
(MISSING "_word_common_token5")))
101+
(line
102+
(word)
103+
(ERROR))
104+
(line
105+
(word)
106+
(word)
107+
(word))
96108
(line
97109
(word)
98110
(word)

grammar.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,9 @@ module.exports = grammar({
6868
// NOT optionlink: single char surrounded by "'".
6969
seq("'", token.immediate(/[^'\n\t ]/), token.immediate("'")),
7070
// NOT taglink: single "|".
71-
/[\t ]\|[\t ]/,
71+
/\|[\t ]/,
72+
// NOT taglink: "|foo".
73+
seq('|', /[^|\n\t ]+/),
7274
// NOT taglink: "||".
7375
/\|\|*/,
7476
// NOT argument: "{}".

0 commit comments

Comments
 (0)