Skip to content

Commit e40131e

Browse files
committed
fix: parsing table cell content of "-"
1 parent fab7af3 commit e40131e

File tree

4 files changed

+4544
-4541
lines changed

4 files changed

+4544
-4541
lines changed

corpus/basic.tst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,6 +1414,22 @@ Table.10 - Multiline
14141414
(contents
14151415
(expr)))))))
14161416

1417+
================================================================================
1418+
Table.11 - Cell contents with '-'
1419+
================================================================================
1420+
1421+
| - |
1422+
1423+
--------------------------------------------------------------------------------
1424+
1425+
(document
1426+
(body
1427+
(table
1428+
(row
1429+
(cell
1430+
(contents
1431+
(expr)))))))
1432+
14171433
================================================================================
14181434
Headlines.1a - No eols
14191435
================================================================================

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ org_grammar = {
269269
optional(field('contents', alias($._expr_line, $.contents)))),
270270
hr: $ => seq(
271271
token(prec(1, '|')),
272-
repeat1(seq(token(prec(1, /[-+]+/)), optional('|'))),
272+
repeat1(seq(token.immediate(prec(1, /[-+]+/)), optional('|'))),
273273
$._eol,
274274
),
275275

src/grammar.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1508,7 +1508,7 @@
15081508
"type": "SEQ",
15091509
"members": [
15101510
{
1511-
"type": "TOKEN",
1511+
"type": "IMMEDIATE_TOKEN",
15121512
"content": {
15131513
"type": "PREC",
15141514
"value": 1,

0 commit comments

Comments
 (0)