From 342e0b5b1ac927c26c1e6872d5c2db8eac7fdd94 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 26 Apr 2024 17:54:59 +0200 Subject: [PATCH 1/3] Syntax: Fix backticks and code-spans in table cells This commit... 1. removes `invalid.deprecated` scoping from backticks in table cells 2. fixes code spans treatment in tables. They are terminated by - `|` cell separator - end of line --- messages/next.md | 1 + syntaxes/Markdown.sublime-syntax | 16 ++++++++++++---- tests/syntax_test_markdown.md | 16 +++++++++++++--- 3 files changed, 26 insertions(+), 7 deletions(-) diff --git a/messages/next.md b/messages/next.md index b6173b75..825aa4b4 100644 --- a/messages/next.md +++ b/messages/next.md @@ -7,6 +7,7 @@ feedback you can use [GitHub issues][issues]. - fix premature block quote termination - fix extra backticks when creating fenced code blocks (#749) +- fix syntax highlighting of single backticks and code-spans in table cells ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index a7c590a9..f043fcfd 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -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 +name: Markdown (MDE) scope: text.html.markdown hidden: true @@ -2910,14 +2910,22 @@ contexts: table-cell-content: - match: (?={{balanced_emphasis}}) push: table-cell-emphasis - - match: (?!{{backticks}})`+ - scope: invalid.deprecated.unescaped-backticks.markdown + - include: table-cell-code-spans - include: table-cell-separators - include: images - - include: literals + - include: critics + - include: math-inline + - include: escapes - include: links - include: markups + table-cell-code-spans: + - match: (`+)[^`|]+(\1) + scope: markup.raw.inline.markdown + captures: + 1: punctuation.definition.raw.begin.markdown + 2: punctuation.definition.raw.end.markdown + table-cell-emphasis: - include: emphasis - include: immediately-pop diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 139b54d9..d9165a20 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -2921,8 +2921,9 @@ bar | baz | f\|oo | | ------ | | b `|` az | -| ^^^ meta.table markup.raw.inline - meta.table.header-separator -| ^ meta.table punctuation.separator.table-cell +|^^^^^^^^^^^ meta.table.markdown-gfm - markup.raw +| ^ punctuation.separator.table-cell.markdown +| ^ punctuation.separator.table-cell.markdown | b **|** im | | <- meta.table punctuation.separator.table-cell | ^^^^^ meta.table markup.bold - punctuation.separator.table-cell @@ -2991,8 +2992,17 @@ not a table | | ^ punctuation.separator.table-cell | ^ punctuation.separator.table-cell |`test | me | -|^ invalid.deprecated.unescaped-backticks +|^^^^^^^^^^^^^ 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 From 0da9d6319f3f668594e2ba84afa449ceb8c69510 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 26 Apr 2024 18:51:28 +0200 Subject: [PATCH 2/3] CI: drop ST4 syntax tests --- .github/workflows/ci-syntax-tests.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci-syntax-tests.yml b/.github/workflows/ci-syntax-tests.yml index 5081d478..2de430a0 100644 --- a/.github/workflows/ci-syntax-tests.yml +++ b/.github/workflows/ci-syntax-tests.yml @@ -30,8 +30,6 @@ jobs: include: - build: 3211 default_packages: st3 - - build: 4107 - default_packages: v4107 steps: - uses: actions/checkout@v4 - uses: SublimeText/syntax-test-action@v2 From 0fb999f905fe1c8866dd5274d1f3c99c0bc8331f Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 26 Apr 2024 19:00:13 +0200 Subject: [PATCH 3/3] Bump version 3.1.13 --- messages.json | 3 ++- messages/{next.md => 3.1.13.md} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename messages/{next.md => 3.1.13.md} (92%) diff --git a/messages.json b/messages.json index b31e0c3d..9180ee9c 100644 --- a/messages.json +++ b/messages.json @@ -46,5 +46,6 @@ "3.1.9": "messages/3.1.9.md", "3.1.10": "messages/3.1.10.md", "3.1.11": "messages/3.1.11.md", - "3.1.12": "messages/3.1.12.md" + "3.1.12": "messages/3.1.12.md", + "3.1.13": "messages/3.1.13.md" } diff --git a/messages/next.md b/messages/3.1.13.md similarity index 92% rename from messages/next.md rename to messages/3.1.13.md index 825aa4b4..b69f320a 100644 --- a/messages/next.md +++ b/messages/3.1.13.md @@ -1,4 +1,4 @@ -# MarkdownEditing {version} Changelog +# MarkdownEditing 3.1.13 Changelog Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of feedback you can use [GitHub issues][issues].