From 0f0b14e397c882a40ac3299e30ffce2ffb70037e Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sat, 27 Apr 2024 10:32:47 +0200 Subject: [PATCH 1/9] Syntax: Improve codespans in tables --- messages/next.md | 14 ++++++++ syntaxes/Markdown.sublime-syntax | 38 +++++++++++++++++++-- tests/syntax_test_markdown.md | 57 +++++++++++++++++++++++++++----- 3 files changed, 98 insertions(+), 11 deletions(-) create mode 100644 messages/next.md diff --git a/messages/next.md b/messages/next.md new file mode 100644 index 00000000..eb2fb34e --- /dev/null +++ b/messages/next.md @@ -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 diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index f043fcfd..852588a2 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 (MDE) +name: Markdown scope: text.html.markdown hidden: true @@ -108,6 +108,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]*) @@ -2920,11 +2926,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 diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index d9165a20..991fca42 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -2938,6 +2938,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 | @@ -2994,15 +3042,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 From 5ca3c4bfcf247aa127946954996d8433364a7999 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Sat, 27 Apr 2024 10:45:51 +0200 Subject: [PATCH 2/9] Syntax: accept new LaTeX scopes required for https://github.com/sublimehq/Packages/pull/3575 --- tests/syntax_test_markdown.md | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 991fca42..0690b940 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -8215,24 +8215,24 @@ $$ |^ punctuation.definition.math.begin.markdown | ^ - punctuation foo = 1 + 2 * \sqrt{a^2+b^2} -| <- markup.math.block.markdown text.tex.latex.embedded.markdown meta.environment.math.block.dollar.latex variable.other.math.tex -|^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.math.block.markdown text.tex.latex.embedded.markdown meta.environment.math.block.dollar.latex -| ^ keyword.operator.math.tex -| ^ constant.numeric.math.tex -| ^ keyword.operator.math.tex -| ^ constant.numeric.math.tex -| ^ keyword.operator.math.tex -| ^^^^^ support.function.math.tex -| ^^^^^^^^^ meta.group.brace.latex -| ^ punctuation.definition.group.brace.begin.latex -| ^ variable.other.math.tex -| ^ keyword.operator.math.tex -| ^ constant.numeric.math.tex -| ^ keyword.operator.math.tex -| ^ variable.other.math.tex -| ^ keyword.operator.math.tex -| ^ constant.numeric.math.tex -| ^ punctuation.definition.group.brace.end.latex +| <- markup.math.block.markdown text.tex.latex.embedded.markdown meta.environment.math.block.dollar variable.other.math +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^ markup.math.block.markdown text.tex.latex.embedded.markdown meta.environment.math.block.dollar +| ^ keyword.operator +| ^ constant.numeric +| ^ keyword.operator +| ^ constant.numeric +| ^ keyword.operator +| ^^^^^ support.function.math +| ^^^^^^^^^ meta.group.brace +| ^ punctuation.definition.group.brace.begin +| ^ variable.other.math +| ^ keyword.operator, punctuation.separator.superscript +| ^ constant.numeric +| ^ keyword.operator +| ^ variable.other.math +| ^ keyword.operator, punctuation.separator.superscript +| ^ constant.numeric +| ^ punctuation.definition.group.brace.end $$ | <- markup.math.block.markdown text.tex.latex.embedded.markdown meta.environment.math.block.dollar.latex punctuation.definition.math.end.markdown |^ markup.math.block.markdown text.tex.latex.embedded.markdown meta.environment.math.block.dollar.latex punctuation.definition.math.end.markdown From 560dc3f1657d5b048875b02b00d57dbd596bfb49 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 16 Jul 2024 18:54:51 +0200 Subject: [PATCH 3/9] Syntax: Fix Terraform highlighting in fenced code blocks --- messages/next.md | 3 ++- syntaxes/Markdown.sublime-syntax | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/messages/next.md b/messages/next.md index eb2fb34e..c59bbbcf 100644 --- a/messages/next.md +++ b/messages/next.md @@ -5,7 +5,8 @@ feedback you can use [GitHub issues][issues]. ## Bug Fixes -- improve code span patterns in table cells +* improve code span patterns in table cells +* Fix Terraform syntax highlighting in fenced code blocks (#765) ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 852588a2..662378ff 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -2521,7 +2521,7 @@ contexts: 5: constant.other.language-name.markdown 6: comment.line.infostring.markdown 7: meta.fold.code-fence.begin.markdown - embed: scope:source.json.terraform + embed: scope:source.terraform embed_scope: markup.raw.code-fence.terraform.markdown-gfm escape: '{{fenced_code_block_escape}}' escape_captures: From f3b9dc30c4ead58ed3cd3edc03317eb4002d8df7 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 16 Jul 2024 19:03:10 +0200 Subject: [PATCH 4/9] Syntax: Update fenced codeblock language markers --- messages/next.md | 1 + syntaxes/Markdown.sublime-syntax | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/messages/next.md b/messages/next.md index c59bbbcf..0dd8c1db 100644 --- a/messages/next.md +++ b/messages/next.md @@ -7,6 +7,7 @@ feedback you can use [GitHub issues][issues]. * improve code span patterns in table cells * Fix Terraform syntax highlighting in fenced code blocks (#765) +* add missing language tag names to detect fenced code block syntaxes ## New Features diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 662378ff..3b3f6eef 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -1127,7 +1127,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(applescript|osascript)) + (?i:\s*(applescript|osascript|scpt)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.applescript.markdown-gfm @@ -1247,7 +1247,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(diff|patch)) + (?i:\s*(u?diff|patch)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.diff.markdown-gfm @@ -1267,7 +1267,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(bat|cmd|dos)) + (?i:\s*(bat(?:ch(?:file)?)?|cmd|(?:dos|win)batch)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.dosbatch.markdown-gfm @@ -1287,7 +1287,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(erlang|escript)) + (?i:\s*(erl(?:ang)?|escript)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.erlang.markdown-gfm @@ -1307,7 +1307,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(graphviz)) + (?i:\s*(dot|graphviz|gv)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.graphviz.markdown-gfm @@ -1347,7 +1347,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(haskell)) + (?i:\s*(haskell|hsc?)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.haskell.markdown-gfm @@ -1367,7 +1367,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(html\+php)) + (?i:\s*(html\+php|phtml)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.html-php.markdown-gfm @@ -1387,7 +1387,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(html)) + (?i:\s*(x?html)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.html.markdown-gfm @@ -1427,7 +1427,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(javascript|js)) + (?i:\s*(javascript|js|node)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.javascript.markdown-gfm @@ -1567,7 +1567,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(makefile)) + (?i:\s*(make(?:file)?|mf)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.makefile.markdown-gfm @@ -1669,7 +1669,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(perl)) + (?i:\s*(perl5?)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.perl.markdown-gfm @@ -1709,7 +1709,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(python|py)) + (?i:\s*(python3?|py)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.python.markdown-gfm @@ -1909,7 +1909,7 @@ contexts: - match: |- (?x) {{fenced_code_block_start}} - (?i:\s*(typescript|ts)) + (?i:\s*(typescript|ts(?:node)?)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.typescript.markdown-gfm @@ -3738,7 +3738,7 @@ contexts: - meta_scope: meta.link.inet.markdown markup.underline.link.markdown-gfm # 1. When an autolink ends in ), we scan the entire autolink for the total # number of parentheses. If there is a greater number of closing parentheses - # than opening ones, we don’t consider the last character part of the + # than opening ones, we don’t consider the last character part of the # autolink, in order to facilitate including an autolink inside a parenthesis # 2. If an autolink ends in a semicolon (;), we check to see if it appears to # resemble an entity reference; if the preceding text is & followed by one From a1faa62123b1a06dec0df17af40787dd920990e3 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Jul 2024 14:14:53 +0200 Subject: [PATCH 5/9] Syntax: Add Groovy highlighting to fenced code blocks --- messages/next.md | 2 ++ syntaxes/Markdown.sublime-syntax | 21 +++++++++++++++++++++ tests/syntax_test_markdown.md | 10 ++++++++++ 3 files changed, 33 insertions(+) diff --git a/messages/next.md b/messages/next.md index 0dd8c1db..730f4729 100644 --- a/messages/next.md +++ b/messages/next.md @@ -11,6 +11,8 @@ feedback you can use [GitHub issues][issues]. ## New Features +* syntax highlighting for Groovy in fenced code blocks (#768) + ## Changes [issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 3b3f6eef..ecf50ff4 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -1038,6 +1038,7 @@ contexts: - include: fenced-erlang - include: fenced-graphviz - include: fenced-golang + - include: fenced-groovy - include: fenced-haskell - include: fenced-html-php - include: fenced-html @@ -1323,6 +1324,26 @@ contexts: 1: punctuation.definition.raw.code-fence.end.markdown 2: meta.fold.code-fence.end.markdown + fenced-groovy: + - match: |- + (?x) + {{fenced_code_block_start}} + (?i:\s*(groovy)) + {{fenced_code_block_trailing_infostring_characters}} + captures: + 0: meta.code-fence.definition.begin.groovy.markdown-gfm + 2: punctuation.definition.raw.code-fence.begin.markdown + 5: constant.other.language-name.markdown + 6: comment.line.infostring.markdown + 7: meta.fold.code-fence.begin.markdown + embed: scope:source.groovy + embed_scope: markup.raw.code-fence.groovy.markdown-gfm + escape: '{{fenced_code_block_escape}}' + escape_captures: + 0: meta.code-fence.definition.end.groovy.markdown-gfm + 1: punctuation.definition.raw.code-fence.end.markdown + 2: meta.fold.code-fence.end.markdown + fenced-golang: - match: |- (?x) diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 0690b940..79cdade7 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1610,6 +1610,16 @@ graph n {} |^^ meta.code-fence.definition.end.graphviz.markdown-gfm punctuation.definition.raw.code-fence.end.markdown | ^ meta.code-fence.definition.end.graphviz.markdown-gfm meta.fold.code-fence.end - punctuation +```groovy +| ^^^^^^^ meta.code-fence.definition.begin.groovy.markdown-gfm - meta.fold +| ^ meta.code-fence.definition.begin.groovy.markdown-gfm meta.fold.code-fence.begin.markdown + +| <- markup.raw.code-fence.groovy.markdown-gfm source.groovy +``` +| <- meta.code-fence.definition.end.groovy.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.groovy.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| ^ meta.code-fence.definition.end.groovy.markdown-gfm meta.fold.code-fence.end - punctuation + ```haskell |^^^^^^^^^ meta.code-fence.definition.begin - meta.fold | ^ meta.code-fence.definition.begin meta.fold.code-fence.begin From 7a521e9bab59ba9fd1ad179a10940ace4c1640d2 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Jul 2024 14:37:30 +0200 Subject: [PATCH 6/9] Syntax: Add completions for fenced code block languages --- .../Code Block Syntaxes.sublime-completions | 717 ++++++++++++++++++ 1 file changed, 717 insertions(+) create mode 100644 syntaxes/Code Block Syntaxes.sublime-completions diff --git a/syntaxes/Code Block Syntaxes.sublime-completions b/syntaxes/Code Block Syntaxes.sublime-completions new file mode 100644 index 00000000..abec35fd --- /dev/null +++ b/syntaxes/Code Block Syntaxes.sublime-completions @@ -0,0 +1,717 @@ +{ + "scope": "text.html.markdown meta.code-fence.definition.begin", + "completions": [ + + // ActionScript + { + "trigger": "actionscript", + "annotation": "ActionScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ActionScript code highlighting" + }, + { + "trigger": "as", + "annotation": "ActionScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ActionScript code highlighting" + }, + + // AppleScript + { + "trigger": "applescript", + "annotation": "AppleScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies AppleScript code highlighting" + }, + { + "trigger": "osascript", + "annotation": "AppleScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies AppleScript code highlighting" + }, + { + "trigger": "scpt", + "annotation": "AppleScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies AppleScript code highlighting" + }, + + // C++ + { + "trigger": "c", + "annotation": "C source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C code highlighting" + }, + { + "trigger": "cpp", + "annotation": "C++ source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C++ code highlighting" + }, + { + "trigger": "cxx", + "annotation": "C++ source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C++ code highlighting" + }, + { + "trigger": "c++", + "annotation": "C++ source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C++ code highlighting" + }, + { + "trigger": "h", + "annotation": "C header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C code highlighting" + }, + { + "trigger": "hpp", + "annotation": "C++ header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C++ code highlighting" + }, + { + "trigger": "hxx", + "annotation": "C++ header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C++ code highlighting" + }, + { + "trigger": "h++", + "annotation": "C++ header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C++ code highlighting" + }, + + // C# + { + "trigger": "csharp", + "annotation": "C#", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C# code highlighting" + }, + { + "trigger": "cs", + "annotation": "C#", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C# code highlighting" + }, + { + "trigger": "c#", + "annotation": "C#", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies C# code highlighting" + }, + + // Clojure + { + "trigger": "clojure", + "annotation": "Clojure", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Clojure code highlighting" + }, + { + "trigger": "clj", + "annotation": "Clojure", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Clojure code highlighting" + }, + + // CSS + { + "trigger": "css", + "annotation": "Stylesheet", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies CSS code highlighting" + }, + + // Diff + { + "trigger": "diff", + "annotation": "Diff", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Diff code highlighting" + }, + { + "trigger": "udiff", + "annotation": "Unified Diff", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Diff code highlighting" + }, + { + "trigger": "patch", + "annotation": "Patch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Patch code highlighting" + }, + + // Dosbatch + { + "trigger": "bat", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies DOS batch code highlighting" + }, + { + "trigger": "batch", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies DOS batch code highlighting" + }, + { + "trigger": "batchfile", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies DOS batch code highlighting" + }, + { + "trigger": "cmd", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies DOS batch code highlighting" + }, + { + "trigger": "dosbatch", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies DOS batch code highlighting" + }, + { + "trigger": "winbatch", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies DOS batch code highlighting" + }, + + // Erlang + { + "trigger": "erl", + "annotation": "Erlang", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Erlang code highlighting" + }, + { + "trigger": "erlang", + "annotation": "Erlang", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Erlang code highlighting" + }, + { + "trigger": "escript", + "annotation": "Erlang Script", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Erlang code highlighting" + }, + + // Go + { + "trigger": "go", + "annotation": "Go", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Go code highlighting" + }, + { + "trigger": "golang", + "annotation": "Go", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Go code highlighting" + }, + + // GraphViz + { + "trigger": "dot", + "annotation": "GraphViz", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies GraphViz code highlighting" + }, + { + "trigger": "graphviz", + "annotation": "GraphViz", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies GraphViz code highlighting" + }, + { + "trigger": "gv", + "annotation": "GraphViz", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies GraphViz code highlighting" + }, + + // Haskell + { + "trigger": "haskell", + "annotation": "Haskell", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Haskell code highlighting" + }, + { + "trigger": "hs", + "annotation": "Haskell", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Haskell code highlighting" + }, + { + "trigger": "hsc", + "annotation": "Haskell C binding", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Haskell code highlighting" + }, + + // HTML + { + "trigger": "html", + "annotation": "HTML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies HTML code highlighting" + }, + { + "trigger": "xhtml", + "annotation": "HTML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies HTML code highlighting" + }, + + // Java + { + "trigger": "java", + "annotation": "Java", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Java code highlighting" + }, + { + "trigger": "jsp", + "annotation": "Java Server Pages", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Java Server Pages code highlighting" + }, + { + "trigger": "jspx", + "annotation": "Java Server Pages", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Java Server Pages code highlighting" + }, + + // JavaScript + { + "trigger": "javascript", + "annotation": "JavaScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies JavaScript code highlighting" + }, + { + "trigger": "js", + "annotation": "JavaScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies JavaScript code highlighting" + }, + { + "trigger": "node", + "annotation": "JavaScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies JavaScript code highlighting" + }, + { + "trigger": "jsx", + "annotation": "JavaScript React", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies JavaScript React code highlighting" + }, + { + "trigger": "ts", + "annotation": "TypeScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies TypeScript code highlighting" + }, + { + "trigger": "tsnode", + "annotation": "TypeScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies TypeScript code highlighting" + }, + { + "trigger": "tsx", + "annotation": "TypeScript React", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies TypeScript React code highlighting" + }, + { + "trigger": "typescript", + "annotation": "TypeScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies TypeScript code highlighting" + }, + + // JSON + { + "trigger": "json", + "annotation": "JSON", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies JSON code highlighting" + }, + { + "trigger": "jsonc", + "annotation": "JSON with Comments", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies JSON with Comments code highlighting" + }, + + // LaTeX + { + "trigger": "tex", + "annotation": "TeX", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies TeX code highlighting" + }, + { + "trigger": "latex", + "annotation": "LaTeX", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies LaTeX code highlighting" + }, + + // Lisp + { + "trigger": "lisp", + "annotation": "Lisp", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Lisp code highlighting" + }, + + // Lua + { + "trigger": "lua", + "annotation": "Lua", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Lua code highlighting" + }, + + // Makefile + { + "trigger": "make", + "annotation": "Makefile", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Makefile code highlighting" + }, + { + "trigger": "makefile", + "annotation": "Makefile", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Makefile code highlighting" + }, + { + "trigger": "mf", + "annotation": "Makefile", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Makefile code highlighting" + }, + + // Matlab + { + "trigger": "matlab", + "annotation": "MatLab", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies MatLab code highlighting" + }, + + // Objective C++ + { + "trigger": "objc", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C code highlighting" + }, + { + "trigger": "objectivec", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C code highlighting" + }, + { + "trigger": "obj-c", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C code highlighting" + }, + { + "trigger": "objective-c", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C code highlighting" + }, + { + "trigger": "objc++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C++ code highlighting" + }, + { + "trigger": "objectivec++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C++ code highlighting" + }, + { + "trigger": "obj-c++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C++ code highlighting" + }, + { + "trigger": "objective-c++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Objective-C++ code highlighting" + }, + + // OCaml + { + "trigger": "ocaml", + "annotation": "OCaml", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies OCaml code highlighting" + }, + + // Perl + { + "trigger": "perl", + "annotation": "Perl 5", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Perl 5 code highlighting" + }, + { + "trigger": "perl5", + "annotation": "Perl 5", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Perl 5 code highlighting" + }, + + // PHP + { + "trigger": "html+php", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies HTML+PHP code highlighting" + }, + { + "trigger": "phtml", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies HTML+PHP code highlighting" + }, + { + "trigger": "inc", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies PHP code highlighting" + }, + { + "trigger": "php", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies PHP code highlighting" + }, + + // Python + { + "trigger": "python", + "annotation": "Python", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Python code highlighting" + }, + { + "trigger": "python3", + "annotation": "Python", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Python code highlighting" + }, + { + "trigger": "py", + "annotation": "Python", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Python code highlighting" + }, + + // R + { + "trigger": "r", + "annotation": "R", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies R code highlighting" + }, + { + "trigger": "splus", + "annotation": "R", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies R code highlighting" + }, + + // Ruby + { + "trigger": "ruby", + "annotation": "Ruby", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Ruby code highlighting" + }, + { + "trigger": "rb", + "annotation": "Ruby", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Ruby code highlighting" + }, + { + "trigger": "rbx", + "annotation": "Ruby on Rails", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Ruby on Rails code highlighting" + }, + + // Regular Expressions + { + "trigger": "regex", + "annotation": "Regular Expressions", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Regular Expressions code highlighting" + }, + { + "trigger": "regexp", + "annotation": "Regular Expressions", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Regular Expressions code highlighting" + }, + + // Rust + { + "trigger": "rust", + "annotation": "Rust", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Rust code highlighting" + }, + { + "trigger": "rs", + "annotation": "Rust", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Rust code highlighting" + }, + { + "trigger": "rscript", + "annotation": "R Script", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies R Script code highlighting" + }, + + // Scala + { + "trigger": "scala", + "annotation": "Scala", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Scala code highlighting" + }, + + // ShellScript + { + "trigger": "bash", + "annotation": "Bourne Against Shell", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ShellScript code highlighting" + }, + { + "trigger": "console", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ShellScript code highlighting" + }, + { + "trigger": "shell-script", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ShellScript code highlighting" + }, + { + "trigger": "shell", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ShellScript code highlighting" + }, + { + "trigger": "sh", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ShellScript code highlighting" + }, + { + "trigger": "zsh", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies ShellScript code highlighting" + }, + + // SQL + { + "trigger": "sql", + "annotation": "SQL", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies SQL code highlighting" + }, + + // XML + { + "trigger": "atom", + "annotation": "ATOM", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies XML code highlighting" + }, + { + "trigger": "plist", + "annotation": "PList", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies XML code highlighting" + }, + { + "trigger": "svg", + "annotation": "SVG", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies XML code highlighting" + }, + { + "trigger": "xjb", + "annotation": "XJB", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies XML code highlighting" + }, + { + "trigger": "xml", + "annotation": "XML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies XML code highlighting" + }, + { + "trigger": "xsd", + "annotation": "XSD", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies XML code highlighting" + }, + { + "trigger": "xsl", + "annotation": "XSL", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies XML code highlighting" + }, + + // YAML + { + "trigger": "yaml", + "annotation": "YAML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies YAML code highlighting" + }, + { + "trigger": "yml", + "annotation": "YAML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies YAML code highlighting" + }, + ], +} From 933e1141956b95831815f57d3d971ec06b855ca5 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Tue, 23 Jul 2024 14:33:11 +0200 Subject: [PATCH 7/9] Syntax: ST4 specific update for Groovy support --- syntaxes/Code Block Syntaxes.sublime-completions | 8 ++++++++ syntaxes/Markdown.sublime-syntax | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/syntaxes/Code Block Syntaxes.sublime-completions b/syntaxes/Code Block Syntaxes.sublime-completions index abec35fd..a5439ff7 100644 --- a/syntaxes/Code Block Syntaxes.sublime-completions +++ b/syntaxes/Code Block Syntaxes.sublime-completions @@ -240,6 +240,14 @@ "details": "Specifies GraphViz code highlighting" }, + // Groovy + { + "trigger": "groovy", + "annotation": "Groovy", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies Groovy code highlighting" + }, + // Haskell { "trigger": "haskell", diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index 32ea726b..db355caa 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -1439,7 +1439,9 @@ contexts: 6: comment.line.infostring.markdown 7: meta.fold.code-fence.begin.markdown embed: scope:source.groovy - embed_scope: markup.raw.code-fence.groovy.markdown-gfm + embed_scope: + markup.raw.code-fence.groovy.markdown-gfm + source.groovy escape: '{{fenced_code_block_escape}}' escape_captures: 0: meta.code-fence.definition.end.groovy.markdown-gfm From 00af35dce3c577be0d71ec2182783c84c2781a98 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Thu, 25 Jul 2024 14:39:16 +0200 Subject: [PATCH 8/9] Syntax: Add support for ==highlight== tags --- Default (Linux).sublime-keymap | 21 ++++++ Default (OSX).sublime-keymap | 21 ++++++ Default (Windows).sublime-keymap | 21 ++++++ messages/next.md | 1 + syntaxes/Markdown.sublime-syntax | 25 ++++++- tests/syntax_test_markdown.md | 122 ++++++++++++++++++++++++++++++- 6 files changed, 206 insertions(+), 5 deletions(-) diff --git a/Default (Linux).sublime-keymap b/Default (Linux).sublime-keymap index d0f839e7..af96e827 100644 --- a/Default (Linux).sublime-keymap +++ b/Default (Linux).sublime-keymap @@ -205,6 +205,27 @@ ] }, + // + // Auto-Pairing Highlight + // + + { "keys": ["="], "command": "insert_snippet", "args": {"contents": "==${0:$SELECTION}=="}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } + ] + }, + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left Right 2.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "==$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^==", "match_all": true } + ] + }, + // // Auto-Pairing Strike Through // diff --git a/Default (OSX).sublime-keymap b/Default (OSX).sublime-keymap index e7500b82..08df0d66 100644 --- a/Default (OSX).sublime-keymap +++ b/Default (OSX).sublime-keymap @@ -205,6 +205,27 @@ ] }, + // + // Auto-Pairing Highlight + // + + { "keys": ["="], "command": "insert_snippet", "args": {"contents": "==${0:$SELECTION}=="}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } + ] + }, + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left Right 2.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "==$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^==", "match_all": true } + ] + }, + // // Auto-Pairing Strike Through // diff --git a/Default (Windows).sublime-keymap b/Default (Windows).sublime-keymap index d0f839e7..af96e827 100644 --- a/Default (Windows).sublime-keymap +++ b/Default (Windows).sublime-keymap @@ -205,6 +205,27 @@ ] }, + // + // Auto-Pairing Highlight + // + + { "keys": ["="], "command": "insert_snippet", "args": {"contents": "==${0:$SELECTION}=="}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": false, "match_all": true } + ] + }, + { "keys": ["backspace"], "command": "run_macro_file", "args": {"file": "Packages/MarkdownEditing/macros/Delete Left Right 2.sublime-macro"}, "context": + [ + { "key": "selector", "operator": "equal", "operand": "text.html.markdown - meta.frontmatter - meta.disable-markdown - markup.raw - markup.kbd", "match_all": true }, + { "key": "setting.auto_match_enabled", "operator": "equal", "operand": true }, + { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }, + { "key": "preceding_text", "operator": "regex_contains", "operand": "==$", "match_all": true }, + { "key": "following_text", "operator": "regex_contains", "operand": "^==", "match_all": true } + ] + }, + // // Auto-Pairing Strike Through // diff --git a/messages/next.md b/messages/next.md index 730f4729..0cc6f0cb 100644 --- a/messages/next.md +++ b/messages/next.md @@ -11,6 +11,7 @@ feedback you can use [GitHub issues][issues]. ## New Features +* syntax highlighting for `==highlight==` emphasis (#764) * syntax highlighting for Groovy in fenced code blocks (#768) ## Changes diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index ecf50ff4..52d58fa4 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -3017,6 +3017,7 @@ contexts: emphasis: - include: bold - include: italic + - include: highlight - include: strikethrough images: @@ -3142,6 +3143,7 @@ contexts: scope: punctuation.definition.italic.end.markdown set: bold-after-bold-italic-asterisk - include: emphasis-common + - include: highlight - include: strikethrough bold-after-bold-italic-asterisk: @@ -3188,6 +3190,7 @@ contexts: scope: punctuation.definition.bold.end.markdown set: italic-after-bold-italic-underscore - include: emphasis-common + - include: highlight - include: strikethrough bold-after-bold-italic-underscore: @@ -3217,6 +3220,7 @@ contexts: bold-common: - include: emphasis-common - include: italic + - include: highlight - include: strikethrough italic: @@ -3256,8 +3260,25 @@ contexts: italic-common: - include: emphasis-common - include: bold + - include: highlight - include: strikethrough + highlight: + - match: ==(?![=>\s]) # 2x = but no => + scope: punctuation.definition.highlight.begin.markdown + push: highlight-content + - match: =+(?![=>\s]) # any number of = not looking like => + + highlight-content: + - meta_scope: markup.highlight.markdown + - match: ==(?!=) # 2x = + scope: punctuation.definition.highlight.end.markdown + pop: true + - match: '[ \t]*=+' + - include: emphasis-common + - include: bold + - include: italic + strikethrough: # https://github.github.com/gfm/#strikethrough-extension- - match: ~~(?![~}>\s]) # 2x ~ but no ~> or ~~} @@ -3270,7 +3291,7 @@ contexts: - match: ~~(?:(?!~)|(?=~~}|~>)) # 2x ~ maybe followed by ~> or ~~} scope: punctuation.definition.strikethrough.end.markdown pop: true - - match: ~+(?:(?!~)|(?=~~}|~>)) # any number of ~ maybe followed by ~> or ~~} + - match: '[ \t]*~+(?:(?!~)|(?=~~}|~>))' # any number of ~ maybe followed by ~> or ~~} - include: emphasis-common - include: bold - include: italic @@ -3759,7 +3780,7 @@ contexts: - meta_scope: meta.link.inet.markdown markup.underline.link.markdown-gfm # 1. When an autolink ends in ), we scan the entire autolink for the total # number of parentheses. If there is a greater number of closing parentheses - # than opening ones, we don’t consider the last character part of the + # than opening ones, we don’t consider the last character part of the # autolink, in order to facilitate including an autolink inside a parenthesis # 2. If an autolink ends in a semicolon (;), we check to see if it appears to # resemble an entity reference; if the preceding text is & followed by one diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index 79cdade7..beb66b8a 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -6947,6 +6947,117 @@ __test text__ *formatted* | ^ punctuation | ^ punctuation +# TEST: HIGHLIGHT ############################################################# + +__==bold highlight==__ +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.highlight +| ^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.highlight.markdown +| ^^ markup.bold.markdown - markup.highlight +|^ punctuation.definition.bold.begin.markdown +| ^^ punctuation.definition.highlight.begin.markdown +| ^^ punctuation.definition.highlight.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +**==bold highlight==** +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.highlight +| ^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.highlight.markdown +| ^^ markup.bold.markdown - markup.highlight +|^ punctuation.definition.bold.begin.markdown +| ^^ punctuation.definition.highlight.begin.markdown +| ^^ punctuation.definition.highlight.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +_==italic highlight==_ +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.highlight.markdown +| ^ markup.italic.markdown - markup.highlight +|^^ punctuation.definition.highlight.begin.markdown +| ^^ punctuation.definition.highlight.end.markdown +| ^ punctuation.definition.italic.end.markdown + +*==italic highlight==* +| <- markup.italic.markdown punctuation.definition.italic.begin.markdown +|^^^^^^^^^^^^^^^^^^^^ markup.italic.markdown markup.highlight.markdown +| ^ markup.italic.markdown - markup.highlight +|^^ punctuation.definition.highlight.begin.markdown +| ^^ punctuation.definition.highlight.end.markdown +| ^ punctuation.definition.italic.end.markdown + +___==bold italic highlight==___ +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.italic - markup.highlight +| ^ markup.bold.markdown markup.italic.markdown - markup.highlight +| ^^^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.highlight.markdown +| ^ markup.bold.markdown markup.italic.markdown - markup.highlight +| ^^ markup.bold.markdown - markup.italic - markup.highlight +|^ punctuation.definition.bold.begin.markdown +| ^ punctuation.definition.italic.begin.markdown +| ^^ punctuation.definition.highlight.begin.markdown +| ^^ punctuation.definition.highlight.end.markdown +| ^ punctuation.definition.italic.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +***==bold italic highlight==*** +| <- markup.bold.markdown punctuation.definition.bold.begin.markdown +|^ markup.bold.markdown - markup.italic - markup.highlight +| ^ markup.bold.markdown markup.italic.markdown - markup.highlight +| ^^^^^^^^^^^^^^^^^^^^^^^^^ markup.bold.markdown markup.italic.markdown markup.highlight.markdown +| ^ markup.bold.markdown markup.italic.markdown - markup.highlight +| ^^ markup.bold.markdown - markup.italic - markup.highlight +|^ punctuation.definition.bold.begin.markdown +| ^ punctuation.definition.italic.begin.markdown +| ^^ punctuation.definition.highlight.begin.markdown +| ^^ punctuation.definition.highlight.end.markdown +| ^ punctuation.definition.italic.end.markdown +| ^^ punctuation.definition.bold.end.markdown + +=Hi= Hello, world! +| <- - punctuation.definition.highlight +|^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.highlight + +This =text==== is ====curious=. +|^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph - markup +| ^ - punctuation.definition.highlight +| ^^^^ - punctuation.definition.highlight +| ^^^^ - punctuation.definition.highlight +| ^ - punctuation.definition.highlight + +This ==text==== is ====curious==. +|^^^^ meta.paragraph - markup +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph markup.highlight +| ^^ meta.paragraph - markup +| ^^ punctuation.definition.highlight.begin +| ^^^^ - punctuation.definition.highlight +| ^^^^ - punctuation.definition.highlight +| ^^ punctuation.definition.highlight.end + +This ==is ==highlighted== inline text +|^^^^ - markup.highlight +| ^^^^^^^^^^^^^^^^^^^^ markup.highlight.markdown +| ^^^^^^^^^^^^ - markup.highlight + +This ==has a +| ^^^^^^^^ meta.paragraph markup.highlight + +| <- meta.paragraph markup.highlight invalid.illegal.non-terminated.bold-italic +new paragraph==. +| ^^ meta.paragraph markup.highlight punctuation.definition.highlight.begin + +| <- invalid.illegal.non-terminated.bold-italic + +A ==[highlight](https://link-url)== +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.highlight.markdown + +A ==![highlight](https://image-url)== +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.highlight.markdown + +A ==[![highlight](image-url)](link-url)== +| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.highlight.markdown + + # TEST: STRIKETHROUGH ######################################################### __~~bold striked~~__ @@ -7034,6 +7145,11 @@ This ~~text~~~~ is ~~~~curious~~. | ^^^^ - punctuation.definition.strikethrough | ^^ punctuation.definition.strikethrough.end +This ~~is ~~striked~~ inline text +|^^^^ - markup.strikethrough +| ^^^^^^^^^^^^^^^^ markup.strikethrough.markdown-gfm +| ^^^^^^^^^^^^^ - markup.strikethrough + This ~~has a | ^^^^^^^^ meta.paragraph markup.strikethrough @@ -7043,13 +7159,13 @@ new paragraph~~. | <- invalid.illegal.non-terminated.bold-italic -A ~~[striked](https://link-url)~~ +A ~~[highlight](https://link-url)~~ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.strikethrough.markdown-gfm -A ~~![striked](https://image-url)~~ +A ~~![highlight](https://image-url)~~ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.strikethrough.markdown-gfm -A ~~[![striked](image-url)](link-url)~~ +A ~~[![highlight](image-url)](link-url)~~ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.paragraph.markdown markup.strikethrough.markdown-gfm From f9d3026c0a16fdfe1568e62469221aa3276b763c Mon Sep 17 00:00:00 2001 From: deathaxe Date: Thu, 25 Jul 2024 15:04:15 +0200 Subject: [PATCH 9/9] Bump version 3.1.14 --- messages.json | 3 ++- messages/{next.md => 3.1.14.md} | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) rename messages/{next.md => 3.1.14.md} (93%) diff --git a/messages.json b/messages.json index 9180ee9c..8a823144 100644 --- a/messages.json +++ b/messages.json @@ -47,5 +47,6 @@ "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.13": "messages/3.1.13.md" + "3.1.13": "messages/3.1.13.md", + "3.1.14": "messages/3.1.14.md" } diff --git a/messages/next.md b/messages/3.1.14.md similarity index 93% rename from messages/next.md rename to messages/3.1.14.md index 0cc6f0cb..0214a265 100644 --- a/messages/next.md +++ b/messages/3.1.14.md @@ -1,4 +1,4 @@ -# MarkdownEditing {version} Changelog +# MarkdownEditing 3.1.14 Changelog Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of feedback you can use [GitHub issues][issues].