diff --git a/messages.json b/messages.json index 628d9e8d..aa51b540 100644 --- a/messages.json +++ b/messages.json @@ -35,5 +35,6 @@ "3.0.6": "messages/3.0.6.md", "3.0.7": "messages/3.0.7.md", "3.1.0": "messages/3.1.0.md", - "3.1.1": "messages/3.1.1.md" + "3.1.1": "messages/3.1.1.md", + "3.1.2": "messages/3.1.2.md" } diff --git a/messages/3.1.2.md b/messages/3.1.2.md new file mode 100644 index 00000000..23afef2e --- /dev/null +++ b/messages/3.1.2.md @@ -0,0 +1,18 @@ +# MarkdownEditing 3.1.2 Changelog + +Your _MarkdownEditing_ plugin is updated. Enjoy new version. For any type of +feedback you can use [GitHub issues][issues]. + +## Bug Fixes + +* fix strikethrough visibility with `line_highlight` +* don't add symbols of fenced code blocks to symbol list +* fix interactive shell highlighting in fenced code blocks + +## New Features + +## Changes + +* MardownEditings color schemes now underline link urls (fixes #685) + +[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues diff --git a/plugins/references.py b/plugins/references.py index 29bd0096..76cced0e 100644 --- a/plugins/references.py +++ b/plugins/references.py @@ -932,7 +932,6 @@ def on_query_completions(self, _, locations): sublime.INHIBIT_WORD_COMPLETIONS | sublime.INHIBIT_EXPLICIT_COMPLETIONS, ) - else: class MdeReferenceCompletionsProvider(MdeViewEventListener): diff --git a/schemes/Mariana.sublime-color-scheme b/schemes/Mariana.sublime-color-scheme index e3b1dd2b..063cd7a4 100644 --- a/schemes/Mariana.sublime-color-scheme +++ b/schemes/Mariana.sublime-color-scheme @@ -63,7 +63,7 @@ { "name": "Markdown: Striked Punctuations", "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata | markup.bold punctuation.definition.bold | markup.italic punctuation.definition.italic | string punctuation.definition.string)", - "foreground": "var(blue2)", + "foreground": "var(blue6)", "font_style": "" }, { diff --git a/schemes/MarkdownEditor-ArcDark.sublime-color-scheme b/schemes/MarkdownEditor-ArcDark.sublime-color-scheme index 137fd3c1..f3676afb 100644 --- a/schemes/MarkdownEditor-ArcDark.sublime-color-scheme +++ b/schemes/MarkdownEditor-ArcDark.sublime-color-scheme @@ -265,9 +265,19 @@ "scope": "markup.underline.link, constant.other.reference.link", "foreground": "#555555" }, + { + "name": "Markdown: Link URL Separators", + "scope": "markup.underline.link punctuation.separator", + "foreground": "#555555" + }, { "name": "Markup: Plain Link", - "scope": "meta.link.inet markup.underline.link, meta.link.email.lt-gt markup.underline.link", + "scope": "meta.link.inet markup.underline.link, meta.link.email markup.underline.link", + "foreground": "#bbbb77" + }, + { + "name": "Markdown: Plain Link Separators", + "scope": "meta.link.inet markup.underline.link punctuation.separator, meta.link.email markup.underline.link punctuation.separator", "foreground": "#bbbb77" }, { @@ -350,6 +360,11 @@ "scope": "markup.strikethrough markup.kbd.content", "foreground": "#484848" }, + { + "name": "Markdown: Underline", + "scope": "markup.underline", + "font_style": "underline" + }, // // Markups diff --git a/schemes/MarkdownEditor-Dark.sublime-color-scheme b/schemes/MarkdownEditor-Dark.sublime-color-scheme index 16f33ffa..ebee93fd 100644 --- a/schemes/MarkdownEditor-Dark.sublime-color-scheme +++ b/schemes/MarkdownEditor-Dark.sublime-color-scheme @@ -273,9 +273,19 @@ "foreground": "#555555", "background": "#171717" }, + { + "name": "Markdown: Link URL Separators", + "scope": "markup.underline.link punctuation.separator", + "foreground": "#555555" + }, { "name": "Markdown: Plain Link", - "scope": "meta.link.inet markup.underline.link, meta.link.email.lt-gt markup.underline.link", + "scope": "meta.link.inet markup.underline.link, meta.link.email markup.underline.link", + "foreground": "#bbbb77" + }, + { + "name": "Markdown: Plain Link Separators", + "scope": "meta.link.inet markup.underline.link punctuation.separator, meta.link.email markup.underline.link punctuation.separator", "foreground": "#bbbb77" }, { @@ -362,6 +372,11 @@ "foreground": "#484848", "background": "#222222" }, + { + "name": "Markdown: Underline", + "scope": "markup.underline", + "font_style": "underline" + }, // // Markups diff --git a/schemes/MarkdownEditor-Focus.sublime-color-scheme b/schemes/MarkdownEditor-Focus.sublime-color-scheme index 1fb80e1c..da939a68 100644 --- a/schemes/MarkdownEditor-Focus.sublime-color-scheme +++ b/schemes/MarkdownEditor-Focus.sublime-color-scheme @@ -294,9 +294,19 @@ "scope": "markup.underline.link, constant.other.reference.link", "foreground": "#AAAAAA" }, + { + "name": "Markdown: Link URL Separators", + "scope": "markup.underline.link punctuation.separator", + "foreground": "#AAAAAA" + }, { "name": "Markdown: Plain Link", - "scope": "meta.link.inet markup.underline.link, meta.link.email.lt-gt markup.underline.link", + "scope": "meta.link.inet markup.underline.link, meta.link.email markup.underline.link", + "foreground": "#444488" + }, + { + "name": "Markdown: Plain Link Separators", + "scope": "meta.link.inet markup.underline.link punctuation.separator, meta.link.email markup.underline.link punctuation.separator", "foreground": "#444488" }, { @@ -381,6 +391,11 @@ "foreground": "#aaaaaa", "background": "#cccccc" }, + { + "name": "Markdown: Underline", + "scope": "markup.underline", + "font_style": "underline" + }, // // Markups diff --git a/schemes/MarkdownEditor-Yellow.sublime-color-scheme b/schemes/MarkdownEditor-Yellow.sublime-color-scheme index 71f32eef..a022bf28 100644 --- a/schemes/MarkdownEditor-Yellow.sublime-color-scheme +++ b/schemes/MarkdownEditor-Yellow.sublime-color-scheme @@ -271,9 +271,19 @@ "scope": "markup.underline.link, constant.other.reference.link", "foreground": "#b7a884" }, + { + "name": "Markdown: Link URL Separators", + "scope": "markup.underline.link punctuation.separator", + "foreground": "#b7a884" + }, { "name": "Markdown: Plain Link", - "scope": "meta.link.inet markup.underline.link, meta.link.email.lt-gt markup.underline.link", + "scope": "meta.link.inet markup.underline.link, meta.link.email markup.underline.link", + "foreground": "#624369" + }, + { + "name": "Markdown: Plain Link Separators", + "scope": "meta.link.inet markup.underline.link punctuation.separator, meta.link.email markup.underline.link punctuation.separator", "foreground": "#624369" }, { @@ -360,6 +370,11 @@ "foreground": "#c2b58e", "background": "#e2daab" }, + { + "name": "Markdown: Underline", + "scope": "markup.underline", + "font_style": "underline" + }, // // Markups diff --git a/schemes/MarkdownEditor.sublime-color-scheme b/schemes/MarkdownEditor.sublime-color-scheme index b6cb2669..95ee46db 100644 --- a/schemes/MarkdownEditor.sublime-color-scheme +++ b/schemes/MarkdownEditor.sublime-color-scheme @@ -271,9 +271,19 @@ "scope": "markup.underline.link, constant.other.reference.link", "foreground": "#AAAAAA" }, + { + "name": "Markdown: Link URL Separators", + "scope": "markup.underline.link punctuation.separator", + "foreground": "#AAAAAA" + }, { "name": "Markdown: Plain Link", - "scope": "meta.link.inet markup.underline.link, meta.link.email.lt-gt markup.underline.link", + "scope": "meta.link.inet markup.underline.link, meta.link.email markup.underline.link", + "foreground": "#444488" + }, + { + "name": "Markdown: Plain Link Separators", + "scope": "meta.link.inet markup.underline.link punctuation.separator, meta.link.email markup.underline.link punctuation.separator", "foreground": "#444488" }, { @@ -359,6 +369,11 @@ "foreground": "#B7B7B7", "background": "#E6E6E6" }, + { + "name": "Markdown: Underline", + "scope": "markup.underline", + "font_style": "underline" + }, // // Markups diff --git a/schemes/Monokai.sublime-color-scheme b/schemes/Monokai.sublime-color-scheme index 4f3684fd..6d253ad1 100644 --- a/schemes/Monokai.sublime-color-scheme +++ b/schemes/Monokai.sublime-color-scheme @@ -57,19 +57,19 @@ { "name": "Markdown: Striked Content", "scope": "text.html.markdown markup.strikethrough, text.html.markdown markup.strikethrough string", - "foreground": "var(grey)", + "foreground": "var(yellow5)", "font_style": "" }, { "name": "Markdown: Striked Punctuations", "scope": "text.html.markdown markup.strikethrough & (punctuation.definition | punctuation.separator | punctuation.definition.strikethrough | punctuation.definition.constant | punctuation.definition.image | punctuation.definition.link | punctuation.definition.metadata | punctuation.definition.bold | punctuation.definition.italic | punctuation.definition.string)", - "foreground": "var(grey)", + "foreground": "var(yellow5)", "font_style": "" }, { "name": "Markdown: Striked URLs", "scope": "text.html.markdown markup.strikethrough & (markup.underline.link.markdown | markup.underline.link.image.markdown)", - "foreground": "var(grey)" + "foreground": "var(yellow5)", }, { "name": "Markdown: Hard Line Breaks", diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index fc2ffa7b..e54fa12e 100644 --- a/syntaxes/Markdown.sublime-syntax +++ b/syntaxes/Markdown.sublime-syntax @@ -933,6 +933,7 @@ contexts: - include: fenced-ruby - include: fenced-rust - include: fenced-scala + - include: fenced-shell - include: fenced-shell-script - include: fenced-sql - include: fenced-tsx @@ -1550,11 +1551,28 @@ contexts: 0: meta.code-fence.definition.end.scala.markdown-gfm 1: punctuation.definition.raw.code-fence.end.markdown + fenced-shell: + - match: |- + (?x) + {{fenced_code_block_start}} + ((?i:console|shell)) + {{fenced_code_block_trailing_infostring_characters}} + captures: + 0: meta.code-fence.definition.begin.shell.markdown-gfm + 2: punctuation.definition.raw.code-fence.begin.markdown + 5: constant.other.language-name.markdown + embed: scope:source.shell.interactive.markdown + embed_scope: markup.raw.code-fence.shell.markdown-gfm + escape: '{{fenced_code_block_escape}}' + escape_captures: + 0: meta.code-fence.definition.end.shell.markdown-gfm + 1: punctuation.definition.raw.code-fence.end.markdown + fenced-shell-script: - match: |- (?x) {{fenced_code_block_start}} - ((?i:console|shell(?:-script)?|sh|bash|zsh)) + ((?i:shell-script|sh|bash|zsh)) {{fenced_code_block_trailing_infostring_characters}} captures: 0: meta.code-fence.definition.begin.shell-script.markdown-gfm @@ -3141,7 +3159,7 @@ contexts: scope: punctuation.definition.attributes.end.markdown pop: true - match: \, - scope: punctuation.separator.mapping.pair.markdown + scope: punctuation.separator.sequence.markdown - match: '{{tag_attribute_name_start}}' push: [tag-attr-meta, tag-attr-equals, tag-attr-name] diff --git a/syntaxes/MultiMarkdown.sublime-syntax b/syntaxes/MultiMarkdown.sublime-syntax index 5bf6f59f..eeaaf301 100644 --- a/syntaxes/MultiMarkdown.sublime-syntax +++ b/syntaxes/MultiMarkdown.sublime-syntax @@ -3,6 +3,8 @@ name: MultiMarkdown scope: text.html.markdown.multimarkdown +extends: Markdown.sublime-syntax + first_line_match: (?i:^format:\s*complete\s*$) variables: @@ -17,7 +19,7 @@ contexts: multimarkdown-header: - match: ^$ - pop: true + pop: 1 - match: ^(?:{{header}}\s*)? captures: 1: keyword.other.multimarkdown @@ -28,8 +30,8 @@ contexts: - meta_scope: meta.header.multimarkdown - meta_content_scope: string.unquoted.multimarkdown - match: \n - pop: true + pop: 1 multimarkdown-content: - meta_scope: meta.content.multimarkdown - - include: scope:text.html.markdown + - include: markdown diff --git a/syntaxes/Shell (for Markdown).sublime-syntax b/syntaxes/Shell (for Markdown).sublime-syntax new file mode 100644 index 00000000..4abc326d --- /dev/null +++ b/syntaxes/Shell (for Markdown).sublime-syntax @@ -0,0 +1,29 @@ +%YAML 1.2 +--- +name: Interactive Unix Shell +scope: source.shell.interactive.markdown +version: 2 +hidden: true + +extends: Packages/ShellScript/Shell-Unix-Generic.sublime-syntax + +contexts: + prototype: + - meta_prepend: true + # continuation lines begin with `> ` + - match: ^\s*(>)\s + captures: + 1: comment.other.shell + scope: comment.other.shell + + main: + - match: ^(?=\s*\$\s) + push: shell-interactive + - include: statements + + shell-interactive: + - match: ^\s*(\$)(?=\s) + captures: + 1: comment.other.shell + embed: statements + escape: (? scope - text.html.markdown markup.raw.block.fenced.markdown, text.html.markdown meta.toc-list.id + text.html.markdown markup.raw.code-fence, text.html.markdown meta.toc-list.id settings showInSymbolList diff --git a/tests/requirements.txt b/tests/requirements.txt index 90f454f2..51ee8a6b 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -6,4 +6,4 @@ mccabe == 0.6.1 ; python_version == '3.8' pycodestyle == 2.7.0 ; python_version == '3.8' pyflakes == 2.3.1 ; python_version == '3.8' flake8 == 3.9.2 ; python_version == '3.8' -black == 21.5b1 ; python_version == '3.8' +black == 22.1.0 ; python_version == '3.8' diff --git a/tests/syntax_test_markdown.md b/tests/syntax_test_markdown.md index e682f213..bd27e30c 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1933,11 +1933,44 @@ unclosed_paren = ( |^^ meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown ```shell +function foo () { +| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown meta.function.shell keyword.declaration.function.shell +} +| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown meta.function.shell meta.compound.shell punctuation.section.compound.end.shell -| <- markup.raw.code-fence.shell-script.markdown-gfm source.shell.bash +$ ls ~ +| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive comment.other.shell +| ^^ meta.function-call.identifier.shell variable.function.shell +| ^^ meta.function-call.arguments.shell + +output.txt +| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive - meta.function-call - variable +|^^^^^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive - meta.function-call - variable + +$ ls \ +> /foo/ +| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown comment.other.shell +|^^^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown + +$ ls \ +> /foo/ +bar +| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function-call +|^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function-call + +function foo () {} +| <- markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function +|^^^^^^^^^^^^^^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown - meta.function ``` -| <- meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown -|^^ meta.code-fence.definition.end.shell-script.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +| <- meta.code-fence.definition.end.shell.markdown-gfm punctuation.definition.raw.code-fence.end.markdown +|^^ meta.code-fence.definition.end.shell.markdown-gfm punctuation.definition.raw.code-fence.end.markdown + + ```shell + $ ls +| ^^^^^ markup.raw.code-fence.shell.markdown-gfm source.shell.interactive.markdown +| ^ comment.other.shell +| ^^ meta.function-call.identifier.shell variable.function.shell + ``` ```shell-script