Skip to content

Commit

Permalink
Merge branch 'st3-develop' into st4-develop
Browse files Browse the repository at this point in the history
  • Loading branch information
deathaxe committed May 6, 2024
2 parents 98847dd + 5ca3c4b commit 449137e
Show file tree
Hide file tree
Showing 3 changed files with 100 additions and 13 deletions.
14 changes: 14 additions & 0 deletions messages/next.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# MarkdownEditing {version} Changelog

Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of
feedback you can use [GitHub issues][issues].

## Bug Fixes

- improve code span patterns in table cells

## New Features

## Changes

[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues
38 changes: 36 additions & 2 deletions syntaxes/Markdown.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#
# The scope suffix should indicate which flavor of Markdown the feature came from,
# to help make this syntax definition easier to maintain.
name: Markdown (MDE)
name: Markdown
scope: text.html.markdown
version: 2
hidden: true
Expand Down Expand Up @@ -120,6 +120,12 @@ variables:
| (?! \s*\-\s+ | \s+\|){{table_cell}}\|(?!\s+$)
)
table_codespan_content: |-
(?x:
[^`|] # first or only char must not be a backtick or pipe.
(?:[^|]*?[^`|])? # none must be a pipe, the last additionally must not be a backtick
)
fenced_code_block_start: |-
(?x:
([ \t]*)
Expand Down Expand Up @@ -3145,11 +3151,39 @@ contexts:
- include: markups

table-cell-code-spans:
- match: (`+)[^`|]+(\1)
# code-spans quoted with up to 6 backticks are supported
# to avoid usage of slower Oniguruma features
- match: (`{6}){{table_codespan_content}}(`{6})(?!`)
scope: markup.raw.inline.markdown
captures:
1: punctuation.definition.raw.begin.markdown
2: punctuation.definition.raw.end.markdown
- match: (`{5}){{table_codespan_content}}(`{5})(?!`)
scope: markup.raw.inline.markdown
captures:
1: punctuation.definition.raw.begin.markdown
2: punctuation.definition.raw.end.markdown
- match: (`{4}){{table_codespan_content}}(`{4})(?!`)
scope: markup.raw.inline.markdown
captures:
1: punctuation.definition.raw.begin.markdown
2: punctuation.definition.raw.end.markdown
- match: (`{3}){{table_codespan_content}}(`{3})(?!`)
scope: markup.raw.inline.markdown
captures:
1: punctuation.definition.raw.begin.markdown
2: punctuation.definition.raw.end.markdown
- match: (`{2}){{table_codespan_content}}(`{2})(?!`)
scope: markup.raw.inline.markdown
captures:
1: punctuation.definition.raw.begin.markdown
2: punctuation.definition.raw.end.markdown
- match: (`{1}){{table_codespan_content}}(`{1})(?!`)
scope: markup.raw.inline.markdown
captures:
1: punctuation.definition.raw.begin.markdown
2: punctuation.definition.raw.end.markdown
- match: \`+ # consume remainers

table-cell-emphasis:
- include: emphasis
Expand Down
61 changes: 50 additions & 11 deletions tests/syntax_test_markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -3195,6 +3195,54 @@ test
> bar
| <- markup.quote punctuation.definition.blockquote - meta.table

| c1 | c2 | c3 | c4 | c5 | c6 | c7
| --- | --- | --- | --- | --- | --- | ---
| ` ` | ` me ` | `` ` `` | ` `` ` | ``foo`bar`` | ```foo`` | ``foo```
| <- meta.table.markdown-gfm punctuation.separator.table-cell.markdown
| ^^^ meta.table.markdown-gfm markup.raw.inline.markdown
| ^ punctuation.definition.raw.begin.markdown
| ^ punctuation.definition.raw.end.markdown
| ^ punctuation.separator.table-cell
| ^^^^^^ markup.raw.inline.markdown
| ^ punctuation.definition.raw.begin.markdown
| ^ punctuation.definition.raw.end.markdown
| ^^^^^^^ markup.raw.inline.markdown
| ^^ punctuation.definition.raw.begin.markdown
| ^^^ - punctuation
| ^^ punctuation.definition.raw.end.markdown
| ^ punctuation.separator.table-cell
| ^^^^^^ markup.raw.inline.markdown
| ^ punctuation.definition.raw.begin.markdown
| ^^^^ - punctuation
| ^ punctuation.definition.raw.end.markdown
| ^ punctuation.separator.table-cell
| ^^^^^^^^^^^ markup.raw.inline.markdown
| ^^ punctuation.definition.raw.begin.markdown
| ^^^^^^^ - punctuation
| ^^ punctuation.definition.raw.end.markdown
| ^ punctuation.separator.table-cell
| ^^^^^^^^ - markup.raw

| c1 | c2 |
| --- | --- |
| ```` ``` ```` | `````` ````` `````` |
| ^^^^^^^^^^^^^ markup.raw.inline.markdown
| ^^^^ punctuation.definition.raw.begin.markdown
| ^^^^^ - punctuation
| ^^^^ punctuation.definition.raw.end.markdown
| ^^^^^^^^^^^^^^^^^^^ markup.raw.inline.markdown
| ^^^^^^ punctuation.definition.raw.begin.markdown
| ^^^^^^^ - punctuation
| ^^^^^^ punctuation.definition.raw.end.markdown
| table with | `multiple` code `spans`) |
| <- punctuation.separator.table-cell
| ^ punctuation.separator.table-cell
| ^^^^^^^^^^ markup.raw.inline
| ^^^^^^ - markup.raw.inline
| ^^^^^^^ markup.raw.inline



`|` this `|` example `|` is not a table `|`
| ^ punctuation.definition.raw.end - meta.table
| nor is this | because it is not at block level, it immediately follows a paragraph |
Expand Down Expand Up @@ -3251,15 +3299,6 @@ not a table |
|`test | me |
|^^^^^^^^^^^^^ meta.table.markdown-gfm - markup.raw
| ^ punctuation.separator.table-cell
| ` ` | ` me ` |
| <- meta.table.markdown-gfm punctuation.separator.table-cell.markdown
| ^^^ meta.table.markdown-gfm markup.raw.inline.markdown
| ^ punctuation.definition.raw.begin.markdown
| ^ punctuation.definition.raw.end.markdown
| ^ punctuation.separator.table-cell
| ^^^^^^ markup.raw.inline.markdown
| ^ punctuation.definition.raw.begin.markdown
| ^ punctuation.definition.raw.end.markdown

| table | followed by
paragraph
Expand Down Expand Up @@ -8588,11 +8627,11 @@ foo = 1 + 2 * \sqrt{a^2+b^2}
| ^^^^^^^^^ meta.group.brace
| ^ punctuation.definition.group.brace.begin
| ^ variable.other.math
| ^ keyword.operator
| ^ keyword.operator, punctuation.separator.superscript
| ^ constant.numeric
| ^ keyword.operator
| ^ variable.other.math
| ^ keyword.operator
| ^ keyword.operator, punctuation.separator.superscript
| ^ constant.numeric
| ^ punctuation.definition.group.brace.end
$$
Expand Down

0 comments on commit 449137e

Please sign in to comment.