Skip to content

Commit 449137e

Browse files
committed
Merge branch 'st3-develop' into st4-develop
2 parents 98847dd + 5ca3c4b commit 449137e

3 files changed

Lines changed: 100 additions & 13 deletions

File tree

messages/next.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# MarkdownEditing {version} Changelog
2+
3+
Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
4+
feedback you can use [GitHub issues][issues].
5+
6+
## Bug Fixes
7+
8+
- improve code span patterns in table cells
9+
10+
## New Features
11+
12+
## Changes
13+
14+
[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues

syntaxes/Markdown.sublime-syntax

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#
1010
# The scope suffix should indicate which flavor of Markdown the feature came from,
1111
# to help make this syntax definition easier to maintain.
12-
name: Markdown (MDE)
12+
name: Markdown
1313
scope: text.html.markdown
1414
version: 2
1515
hidden: true
@@ -120,6 +120,12 @@ variables:
120120
| (?! \s*\-\s+ | \s+\|){{table_cell}}\|(?!\s+$)
121121
)
122122
123+
table_codespan_content: |-
124+
(?x:
125+
[^`|] # first or only char must not be a backtick or pipe.
126+
(?:[^|]*?[^`|])? # none must be a pipe, the last additionally must not be a backtick
127+
)
128+
123129
fenced_code_block_start: |-
124130
(?x:
125131
([ \t]*)
@@ -3145,11 +3151,39 @@ contexts:
31453151
- include: markups
31463152

31473153
table-cell-code-spans:
3148-
- match: (`+)[^`|]+(\1)
3154+
# code-spans quoted with up to 6 backticks are supported
3155+
# to avoid usage of slower Oniguruma features
3156+
- match: (`{6}){{table_codespan_content}}(`{6})(?!`)
3157+
scope: markup.raw.inline.markdown
3158+
captures:
3159+
1: punctuation.definition.raw.begin.markdown
3160+
2: punctuation.definition.raw.end.markdown
3161+
- match: (`{5}){{table_codespan_content}}(`{5})(?!`)
3162+
scope: markup.raw.inline.markdown
3163+
captures:
3164+
1: punctuation.definition.raw.begin.markdown
3165+
2: punctuation.definition.raw.end.markdown
3166+
- match: (`{4}){{table_codespan_content}}(`{4})(?!`)
3167+
scope: markup.raw.inline.markdown
3168+
captures:
3169+
1: punctuation.definition.raw.begin.markdown
3170+
2: punctuation.definition.raw.end.markdown
3171+
- match: (`{3}){{table_codespan_content}}(`{3})(?!`)
3172+
scope: markup.raw.inline.markdown
3173+
captures:
3174+
1: punctuation.definition.raw.begin.markdown
3175+
2: punctuation.definition.raw.end.markdown
3176+
- match: (`{2}){{table_codespan_content}}(`{2})(?!`)
3177+
scope: markup.raw.inline.markdown
3178+
captures:
3179+
1: punctuation.definition.raw.begin.markdown
3180+
2: punctuation.definition.raw.end.markdown
3181+
- match: (`{1}){{table_codespan_content}}(`{1})(?!`)
31493182
scope: markup.raw.inline.markdown
31503183
captures:
31513184
1: punctuation.definition.raw.begin.markdown
31523185
2: punctuation.definition.raw.end.markdown
3186+
- match: \`+ # consume remainers
31533187

31543188
table-cell-emphasis:
31553189
- include: emphasis

tests/syntax_test_markdown.md

Lines changed: 50 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3195,6 +3195,54 @@ test
31953195
> bar
31963196
| <- markup.quote punctuation.definition.blockquote - meta.table
31973197

3198+
| c1 | c2 | c3 | c4 | c5 | c6 | c7
3199+
| --- | --- | --- | --- | --- | --- | ---
3200+
| ` ` | ` me ` | `` ` `` | ` `` ` | ``foo`bar`` | ```foo`` | ``foo```
3201+
| <- meta.table.markdown-gfm punctuation.separator.table-cell.markdown
3202+
| ^^^ meta.table.markdown-gfm markup.raw.inline.markdown
3203+
| ^ punctuation.definition.raw.begin.markdown
3204+
| ^ punctuation.definition.raw.end.markdown
3205+
| ^ punctuation.separator.table-cell
3206+
| ^^^^^^ markup.raw.inline.markdown
3207+
| ^ punctuation.definition.raw.begin.markdown
3208+
| ^ punctuation.definition.raw.end.markdown
3209+
| ^^^^^^^ markup.raw.inline.markdown
3210+
| ^^ punctuation.definition.raw.begin.markdown
3211+
| ^^^ - punctuation
3212+
| ^^ punctuation.definition.raw.end.markdown
3213+
| ^ punctuation.separator.table-cell
3214+
| ^^^^^^ markup.raw.inline.markdown
3215+
| ^ punctuation.definition.raw.begin.markdown
3216+
| ^^^^ - punctuation
3217+
| ^ punctuation.definition.raw.end.markdown
3218+
| ^ punctuation.separator.table-cell
3219+
| ^^^^^^^^^^^ markup.raw.inline.markdown
3220+
| ^^ punctuation.definition.raw.begin.markdown
3221+
| ^^^^^^^ - punctuation
3222+
| ^^ punctuation.definition.raw.end.markdown
3223+
| ^ punctuation.separator.table-cell
3224+
| ^^^^^^^^ - markup.raw
3225+
3226+
| c1 | c2 |
3227+
| --- | --- |
3228+
| ```` ``` ```` | `````` ````` `````` |
3229+
| ^^^^^^^^^^^^^ markup.raw.inline.markdown
3230+
| ^^^^ punctuation.definition.raw.begin.markdown
3231+
| ^^^^^ - punctuation
3232+
| ^^^^ punctuation.definition.raw.end.markdown
3233+
| ^^^^^^^^^^^^^^^^^^^ markup.raw.inline.markdown
3234+
| ^^^^^^ punctuation.definition.raw.begin.markdown
3235+
| ^^^^^^^ - punctuation
3236+
| ^^^^^^ punctuation.definition.raw.end.markdown
3237+
| table with | `multiple` code `spans`) |
3238+
| <- punctuation.separator.table-cell
3239+
| ^ punctuation.separator.table-cell
3240+
| ^^^^^^^^^^ markup.raw.inline
3241+
| ^^^^^^ - markup.raw.inline
3242+
| ^^^^^^^ markup.raw.inline
3243+
3244+
3245+
31983246
`|` this `|` example `|` is not a table `|`
31993247
| ^ punctuation.definition.raw.end - meta.table
32003248
| nor is this | because it is not at block level, it immediately follows a paragraph |
@@ -3251,15 +3299,6 @@ not a table |
32513299
|`test | me |
32523300
|^^^^^^^^^^^^^ meta.table.markdown-gfm - markup.raw
32533301
| ^ punctuation.separator.table-cell
3254-
| ` ` | ` me ` |
3255-
| <- meta.table.markdown-gfm punctuation.separator.table-cell.markdown
3256-
| ^^^ meta.table.markdown-gfm markup.raw.inline.markdown
3257-
| ^ punctuation.definition.raw.begin.markdown
3258-
| ^ punctuation.definition.raw.end.markdown
3259-
| ^ punctuation.separator.table-cell
3260-
| ^^^^^^ markup.raw.inline.markdown
3261-
| ^ punctuation.definition.raw.begin.markdown
3262-
| ^ punctuation.definition.raw.end.markdown
32633302

32643303
| table | followed by
32653304
paragraph
@@ -8588,11 +8627,11 @@ foo = 1 + 2 * \sqrt{a^2+b^2}
85888627
| ^^^^^^^^^ meta.group.brace
85898628
| ^ punctuation.definition.group.brace.begin
85908629
| ^ variable.other.math
8591-
| ^ keyword.operator
8630+
| ^ keyword.operator, punctuation.separator.superscript
85928631
| ^ constant.numeric
85938632
| ^ keyword.operator
85948633
| ^ variable.other.math
8595-
| ^ keyword.operator
8634+
| ^ keyword.operator, punctuation.separator.superscript
85968635
| ^ constant.numeric
85978636
| ^ punctuation.definition.group.brace.end
85988637
$$

0 commit comments

Comments
 (0)