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.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/3.1.14.md b/messages/3.1.14.md new file mode 100644 index 00000000..0214a265 --- /dev/null +++ b/messages/3.1.14.md @@ -0,0 +1,19 @@ +# MarkdownEditing 3.1.14 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 +* Fix Terraform syntax highlighting in fenced code blocks (#765) +* add missing language tag names to detect fenced code block syntaxes + +## New Features + +* syntax highlighting for `==highlight==` emphasis (#764) +* syntax highlighting for Groovy in fenced code blocks (#768) + +## Changes + +[issues]: https://github.com/SublimeText-Markdown/MarkdownEditing/issues diff --git a/syntaxes/Code Block Syntaxes.sublime-completions b/syntaxes/Code Block Syntaxes.sublime-completions new file mode 100644 index 00000000..a5439ff7 --- /dev/null +++ b/syntaxes/Code Block Syntaxes.sublime-completions @@ -0,0 +1,725 @@ +{ + "scope": "text.html.markdown meta.code-fence.definition.begin", + "completions": [ + + // ActionScript + { + "trigger": "actionscript", + "annotation": "ActionScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ActionScript</code> code highlighting" + }, + { + "trigger": "as", + "annotation": "ActionScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ActionScript</code> code highlighting" + }, + + // AppleScript + { + "trigger": "applescript", + "annotation": "AppleScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>AppleScript</code> code highlighting" + }, + { + "trigger": "osascript", + "annotation": "AppleScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>AppleScript</code> code highlighting" + }, + { + "trigger": "scpt", + "annotation": "AppleScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>AppleScript</code> code highlighting" + }, + + // C++ + { + "trigger": "c", + "annotation": "C source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C</code> code highlighting" + }, + { + "trigger": "cpp", + "annotation": "C++ source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C++</code> code highlighting" + }, + { + "trigger": "cxx", + "annotation": "C++ source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C++</code> code highlighting" + }, + { + "trigger": "c++", + "annotation": "C++ source", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C++</code> code highlighting" + }, + { + "trigger": "h", + "annotation": "C header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C</code> code highlighting" + }, + { + "trigger": "hpp", + "annotation": "C++ header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C++</code> code highlighting" + }, + { + "trigger": "hxx", + "annotation": "C++ header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C++</code> code highlighting" + }, + { + "trigger": "h++", + "annotation": "C++ header", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C++</code> code highlighting" + }, + + // C# + { + "trigger": "csharp", + "annotation": "C#", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C#</code> code highlighting" + }, + { + "trigger": "cs", + "annotation": "C#", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C#</code> code highlighting" + }, + { + "trigger": "c#", + "annotation": "C#", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>C#</code> code highlighting" + }, + + // Clojure + { + "trigger": "clojure", + "annotation": "Clojure", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Clojure</code> code highlighting" + }, + { + "trigger": "clj", + "annotation": "Clojure", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Clojure</code> code highlighting" + }, + + // CSS + { + "trigger": "css", + "annotation": "Stylesheet", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>CSS</code> code highlighting" + }, + + // Diff + { + "trigger": "diff", + "annotation": "Diff", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Diff</code> code highlighting" + }, + { + "trigger": "udiff", + "annotation": "Unified Diff", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Diff</code> code highlighting" + }, + { + "trigger": "patch", + "annotation": "Patch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Patch</code> code highlighting" + }, + + // Dosbatch + { + "trigger": "bat", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>DOS batch</code> code highlighting" + }, + { + "trigger": "batch", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>DOS batch</code> code highlighting" + }, + { + "trigger": "batchfile", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>DOS batch</code> code highlighting" + }, + { + "trigger": "cmd", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>DOS batch</code> code highlighting" + }, + { + "trigger": "dosbatch", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>DOS batch</code> code highlighting" + }, + { + "trigger": "winbatch", + "annotation": "DOS batch", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>DOS batch</code> code highlighting" + }, + + // Erlang + { + "trigger": "erl", + "annotation": "Erlang", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Erlang</code> code highlighting" + }, + { + "trigger": "erlang", + "annotation": "Erlang", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Erlang</code> code highlighting" + }, + { + "trigger": "escript", + "annotation": "Erlang Script", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Erlang</code> code highlighting" + }, + + // Go + { + "trigger": "go", + "annotation": "Go", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Go</code> code highlighting" + }, + { + "trigger": "golang", + "annotation": "Go", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Go</code> code highlighting" + }, + + // GraphViz + { + "trigger": "dot", + "annotation": "GraphViz", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>GraphViz</code> code highlighting" + }, + { + "trigger": "graphviz", + "annotation": "GraphViz", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>GraphViz</code> code highlighting" + }, + { + "trigger": "gv", + "annotation": "GraphViz", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>GraphViz</code> code highlighting" + }, + + // Groovy + { + "trigger": "groovy", + "annotation": "Groovy", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Groovy</code> code highlighting" + }, + + // Haskell + { + "trigger": "haskell", + "annotation": "Haskell", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Haskell</code> code highlighting" + }, + { + "trigger": "hs", + "annotation": "Haskell", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Haskell</code> code highlighting" + }, + { + "trigger": "hsc", + "annotation": "Haskell C binding", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Haskell</code> code highlighting" + }, + + // HTML + { + "trigger": "html", + "annotation": "HTML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>HTML</code> code highlighting" + }, + { + "trigger": "xhtml", + "annotation": "HTML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>HTML</code> code highlighting" + }, + + // Java + { + "trigger": "java", + "annotation": "Java", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Java</code> code highlighting" + }, + { + "trigger": "jsp", + "annotation": "Java Server Pages", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Java Server Pages</code> code highlighting" + }, + { + "trigger": "jspx", + "annotation": "Java Server Pages", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Java Server Pages</code> code highlighting" + }, + + // JavaScript + { + "trigger": "javascript", + "annotation": "JavaScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>JavaScript</code> code highlighting" + }, + { + "trigger": "js", + "annotation": "JavaScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>JavaScript</code> code highlighting" + }, + { + "trigger": "node", + "annotation": "JavaScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>JavaScript</code> code highlighting" + }, + { + "trigger": "jsx", + "annotation": "JavaScript React", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>JavaScript React</code> code highlighting" + }, + { + "trigger": "ts", + "annotation": "TypeScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>TypeScript</code> code highlighting" + }, + { + "trigger": "tsnode", + "annotation": "TypeScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>TypeScript</code> code highlighting" + }, + { + "trigger": "tsx", + "annotation": "TypeScript React", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>TypeScript React</code> code highlighting" + }, + { + "trigger": "typescript", + "annotation": "TypeScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>TypeScript</code> code highlighting" + }, + + // JSON + { + "trigger": "json", + "annotation": "JSON", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>JSON</code> code highlighting" + }, + { + "trigger": "jsonc", + "annotation": "JSON with Comments", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>JSON with Comments</code> code highlighting" + }, + + // LaTeX + { + "trigger": "tex", + "annotation": "TeX", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>TeX</code> code highlighting" + }, + { + "trigger": "latex", + "annotation": "LaTeX", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>LaTeX</code> code highlighting" + }, + + // Lisp + { + "trigger": "lisp", + "annotation": "Lisp", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Lisp</code> code highlighting" + }, + + // Lua + { + "trigger": "lua", + "annotation": "Lua", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Lua</code> code highlighting" + }, + + // Makefile + { + "trigger": "make", + "annotation": "Makefile", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Makefile</code> code highlighting" + }, + { + "trigger": "makefile", + "annotation": "Makefile", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Makefile</code> code highlighting" + }, + { + "trigger": "mf", + "annotation": "Makefile", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Makefile</code> code highlighting" + }, + + // Matlab + { + "trigger": "matlab", + "annotation": "MatLab", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>MatLab</code> code highlighting" + }, + + // Objective C++ + { + "trigger": "objc", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C</code> code highlighting" + }, + { + "trigger": "objectivec", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C</code> code highlighting" + }, + { + "trigger": "obj-c", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C</code> code highlighting" + }, + { + "trigger": "objective-c", + "annotation": "Objective-C", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C</code> code highlighting" + }, + { + "trigger": "objc++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C++</code> code highlighting" + }, + { + "trigger": "objectivec++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C++</code> code highlighting" + }, + { + "trigger": "obj-c++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C++</code> code highlighting" + }, + { + "trigger": "objective-c++", + "annotation": "Objective-C++", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Objective-C++</code> code highlighting" + }, + + // OCaml + { + "trigger": "ocaml", + "annotation": "OCaml", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>OCaml</code> code highlighting" + }, + + // Perl + { + "trigger": "perl", + "annotation": "Perl 5", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Perl 5</code> code highlighting" + }, + { + "trigger": "perl5", + "annotation": "Perl 5", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Perl 5</code> code highlighting" + }, + + // PHP + { + "trigger": "html+php", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>HTML+PHP</code> code highlighting" + }, + { + "trigger": "phtml", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>HTML+PHP</code> code highlighting" + }, + { + "trigger": "inc", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>PHP</code> code highlighting" + }, + { + "trigger": "php", + "annotation": "PHP", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>PHP</code> code highlighting" + }, + + // Python + { + "trigger": "python", + "annotation": "Python", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Python</code> code highlighting" + }, + { + "trigger": "python3", + "annotation": "Python", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Python</code> code highlighting" + }, + { + "trigger": "py", + "annotation": "Python", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Python</code> code highlighting" + }, + + // R + { + "trigger": "r", + "annotation": "R", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>R</code> code highlighting" + }, + { + "trigger": "splus", + "annotation": "R", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>R</code> code highlighting" + }, + + // Ruby + { + "trigger": "ruby", + "annotation": "Ruby", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Ruby</code> code highlighting" + }, + { + "trigger": "rb", + "annotation": "Ruby", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Ruby</code> code highlighting" + }, + { + "trigger": "rbx", + "annotation": "Ruby on Rails", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Ruby on Rails</code> code highlighting" + }, + + // Regular Expressions + { + "trigger": "regex", + "annotation": "Regular Expressions", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Regular Expressions</code> code highlighting" + }, + { + "trigger": "regexp", + "annotation": "Regular Expressions", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Regular Expressions</code> code highlighting" + }, + + // Rust + { + "trigger": "rust", + "annotation": "Rust", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Rust</code> code highlighting" + }, + { + "trigger": "rs", + "annotation": "Rust", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Rust</code> code highlighting" + }, + { + "trigger": "rscript", + "annotation": "R Script", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>R Script</code> code highlighting" + }, + + // Scala + { + "trigger": "scala", + "annotation": "Scala", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>Scala</code> code highlighting" + }, + + // ShellScript + { + "trigger": "bash", + "annotation": "Bourne Against Shell", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ShellScript</code> code highlighting" + }, + { + "trigger": "console", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ShellScript</code> code highlighting" + }, + { + "trigger": "shell-script", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ShellScript</code> code highlighting" + }, + { + "trigger": "shell", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ShellScript</code> code highlighting" + }, + { + "trigger": "sh", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ShellScript</code> code highlighting" + }, + { + "trigger": "zsh", + "annotation": "ShellScript", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>ShellScript</code> code highlighting" + }, + + // SQL + { + "trigger": "sql", + "annotation": "SQL", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>SQL</code> code highlighting" + }, + + // XML + { + "trigger": "atom", + "annotation": "ATOM", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>XML</code> code highlighting" + }, + { + "trigger": "plist", + "annotation": "PList", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>XML</code> code highlighting" + }, + { + "trigger": "svg", + "annotation": "SVG", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>XML</code> code highlighting" + }, + { + "trigger": "xjb", + "annotation": "XJB", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>XML</code> code highlighting" + }, + { + "trigger": "xml", + "annotation": "XML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>XML</code> code highlighting" + }, + { + "trigger": "xsd", + "annotation": "XSD", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>XML</code> code highlighting" + }, + { + "trigger": "xsl", + "annotation": "XSL", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>XML</code> code highlighting" + }, + + // YAML + { + "trigger": "yaml", + "annotation": "YAML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>YAML</code> code highlighting" + }, + { + "trigger": "yml", + "annotation": "YAML", + "kind": ["markup", "s", "Syntax"], + "details": "Specifies <code>YAML</code> code highlighting" + }, + ], +} diff --git a/syntaxes/Markdown.sublime-syntax b/syntaxes/Markdown.sublime-syntax index acc59671..2fb19cd4 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 version: 2 hidden: true @@ -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]*) @@ -1112,6 +1118,7 @@ contexts: - include: fenced-erlang - include: fenced-graphviz - include: fenced-golang + - include: fenced-groovy - include: fenced-haskell - include: fenced-html-php - include: fenced-html @@ -1203,7 +1210,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 @@ -1335,7 +1342,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 @@ -1357,7 +1364,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 @@ -1379,7 +1386,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 @@ -1401,7 +1408,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 @@ -1419,6 +1426,28 @@ 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 + source.groovy + 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) @@ -1445,7 +1474,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 @@ -1467,7 +1496,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 @@ -1489,7 +1518,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 @@ -1533,7 +1562,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 @@ -1687,7 +1716,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 @@ -1797,7 +1826,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 @@ -1841,7 +1870,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 @@ -2061,7 +2090,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 @@ -2731,10 +2760,10 @@ 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 - source.json.terraform + source.terraform escape: '{{fenced_code_block_escape}}' escape_captures: 0: meta.code-fence.definition.end.terraform.markdown-gfm @@ -3145,11 +3174,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 @@ -3187,6 +3244,7 @@ contexts: emphasis: - include: bold - include: italic + - include: highlight - include: strikethrough images: @@ -3321,6 +3379,7 @@ contexts: scope: markup.italic.markdown punctuation.definition.italic.end.markdown set: bold-after-bold-italic-asterisk - include: emphasis-common + - include: highlight - include: strikethrough bold-after-bold-italic-asterisk: @@ -3367,6 +3426,7 @@ contexts: scope: markup.italic.markdown punctuation.definition.bold.end.markdown set: italic-after-bold-italic-underscore - include: emphasis-common + - include: highlight - include: strikethrough bold-after-bold-italic-underscore: @@ -3396,6 +3456,7 @@ contexts: bold-common: - include: emphasis-common - include: italic + - include: highlight - include: strikethrough italic: @@ -3435,8 +3496,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: 1 + - match: '[ \t]*=+' + - include: emphasis-common + - include: bold + - include: italic + strikethrough: # https://github.github.com/gfm/#strikethrough-extension- - match: ~~(?![~}>\s]) # 2x ~ but no ~> or ~~} @@ -3449,7 +3527,7 @@ contexts: - match: ~~(?:(?!~)|(?=~~}|~>)) # 2x ~ maybe followed by ~> or ~~} scope: punctuation.definition.strikethrough.end.markdown pop: 1 - - match: ~+(?:(?!~)|(?=~~}|~>)) # any number of ~ maybe followed by ~> or ~~} + - match: '[ \t]*~+(?:(?!~)|(?=~~}|~>))' # any number of ~ maybe followed by ~> or ~~} - include: emphasis-common - include: bold - include: italic @@ -3938,7 +4016,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 0e1a07c7..cb478d41 100644 --- a/tests/syntax_test_markdown.md +++ b/tests/syntax_test_markdown.md @@ -1853,6 +1853,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 @@ -3195,6 +3205,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 | @@ -3251,15 +3309,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 @@ -7220,6 +7269,117 @@ __test <span>text__ *formatted</span>* | ^ 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~~__ @@ -7307,6 +7467,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 @@ -7316,13 +7481,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 @@ -8588,11 +8753,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 $$