Skip to content

Commit 7be7e04

Browse files
committed
Syntax: Fix code-spans in tables
1 parent c84504e commit 7be7e04

2 files changed

Lines changed: 52 additions & 1 deletion

File tree

syntaxes/Markdown.sublime-syntax

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ variables:
339339
table_codespan_content: |-
340340
(?x:
341341
[^`|] # first or only char must not be a backtick or pipe.
342-
(?:[^|]*?[^`|])? # none must be a pipe, the last additionally must not be a backtick
342+
(?:[^|]*?[^`|])?? # none must be a pipe, the last additionally must not be a backtick
343343
)
344344
345345
table_end: |-

tests/syntax_test_markdown.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3244,6 +3244,57 @@ test
32443244
> bar
32453245
| <- markup.quote punctuation.definition.blockquote - meta.table
32463246

3247+
c1 | c2
3248+
--------- | ---------
3249+
`Row 1` | `a`, `b`, `c`
3250+
|^^^^^^^^^^^^^^^^^^^^^^^^^ meta.table.markdown-gfm
3251+
|^^^^^^ markup.raw.inline.markdown
3252+
| ^ punctuation.definition.raw.end.markdown
3253+
| ^ punctuation.separator.table-cell.markdown
3254+
| ^^^ markup.raw.inline.markdown
3255+
| ^ punctuation.definition.raw.begin.markdown
3256+
| ^ punctuation.definition.raw.end.markdown
3257+
| ^^^ markup.raw.inline.markdown
3258+
| ^ punctuation.definition.raw.begin.markdown
3259+
| ^ punctuation.definition.raw.end.markdown
3260+
| ^^^ markup.raw.inline.markdown
3261+
| ^ punctuation.definition.raw.begin.markdown
3262+
| ^ punctuation.definition.raw.end.markdown
3263+
3264+
c1 | c2
3265+
--------- | ---------
3266+
`Row 2` | ``a``, ``b``, ``c``
3267+
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.table.markdown-gfm
3268+
|^^^^^^ markup.raw.inline.markdown
3269+
| ^ punctuation.definition.raw.end.markdown
3270+
| ^ punctuation.separator.table-cell.markdown
3271+
| ^^^^^ markup.raw.inline.markdown
3272+
| ^^ punctuation.definition.raw.begin.markdown
3273+
| ^^ punctuation.definition.raw.end.markdown
3274+
| ^^^^^ markup.raw.inline.markdown
3275+
| ^^ punctuation.definition.raw.begin.markdown
3276+
| ^^ punctuation.definition.raw.end.markdown
3277+
| ^^^^^ markup.raw.inline.markdown
3278+
| ^^ punctuation.definition.raw.begin.markdown
3279+
| ^^ punctuation.definition.raw.end.markdown
3280+
3281+
c1 | c2
3282+
--------- | ---------
3283+
`Row 3` | ```a```, ```b```, ```c```
3284+
|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.table.markdown-gfm
3285+
|^^^^^^ markup.raw.inline.markdown
3286+
| ^ punctuation.definition.raw.end.markdown
3287+
| ^ punctuation.separator.table-cell.markdown
3288+
| ^^^^^^^ markup.raw.inline.markdown
3289+
| ^^^ punctuation.definition.raw.begin.markdown
3290+
| ^^^ punctuation.definition.raw.end.markdown
3291+
| ^^^^^^^ markup.raw.inline.markdown
3292+
| ^^^ punctuation.definition.raw.begin.markdown
3293+
| ^^^ punctuation.definition.raw.end.markdown
3294+
| ^^^^^^^ markup.raw.inline.markdown
3295+
| ^^^ punctuation.definition.raw.begin.markdown
3296+
| ^^^ punctuation.definition.raw.end.markdown
3297+
32473298
| c1 | c2 | c3 | c4 | c5 | c6 | c7
32483299
| --- | --- | --- | --- | --- | --- | ---
32493300
| ` ` | ` me ` | `` ` `` | ` `` ` | ``foo`bar`` | ```foo`` | ``foo```

0 commit comments

Comments
 (0)