From edba697c3fd4fb4a2f8dc6d446b3dfd647810667 Mon Sep 17 00:00:00 2001 From: Chris LaFreniere <40371649+chlafreniere@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:00:08 -0700 Subject: [PATCH] Add syntaxes folder to markdown-math (#23692) --- .../syntaxes/md-math-block.tmLanguage.json | 85 ++++++++++++++ .../syntaxes/md-math-inline.tmLanguage.json | 79 +++++++++++++ .../syntaxes/md-math.tmLanguage.json | 107 ++++++++++++++++++ 3 files changed, 271 insertions(+) create mode 100644 extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json create mode 100644 extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json create mode 100644 extensions/markdown-math/syntaxes/md-math.tmLanguage.json diff --git a/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json b/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json new file mode 100644 index 0000000000..43fd1bda5d --- /dev/null +++ b/extensions/markdown-math/syntaxes/md-math-block.tmLanguage.json @@ -0,0 +1,85 @@ +{ + "fileTypes": [], + "injectionSelector": "L:text.html.markdown - (comment, string, meta.paragraph.markdown, markup.math.block.markdown, markup.fenced_code.block.markdown, markup.raw.block.markdown)", + "patterns": [ + { + "include": "#double_dollar_math_block" + }, + { + "include": "#single_dollar_math_block" + } + ], + "repository": { + "double_dollar_math_block": { + "name": "markup.math.block.markdown", + "contentName": "meta.embedded.math.markdown", + "begin": "(?<=^\\s*)(\\${2})(?![^$]*\\${2})", + "beginCaptures": { + "1": { + "name": "punctuation.definition.math.begin.markdown" + } + }, + "end": "(.*)(\\${2})", + "endCaptures": { + "1": { + "name": "meta.embedded.math.markdown", + "patterns": [ + { + "include": "text.html.markdown.math#math" + } + ] + }, + "2": { + "name": "punctuation.definition.math.end.markdown" + } + }, + "patterns": [ + { + "begin": "(^|\\G)", + "while": "(^|\\G)(?!.*(\\${2}))", + "patterns": [ + { + "include": "text.html.markdown.math#math" + } + ] + } + ] + }, + "single_dollar_math_block": { + "name": "markup.math.block.markdown", + "contentName": "meta.embedded.math.markdown", + "begin": "(?<=^\\s*)(\\$)(?![^$]*\\$|\\d)", + "beginCaptures": { + "1": { + "name": "punctuation.definition.math.begin.markdown" + } + }, + "end": "(.*)(\\${1})", + "endCaptures": { + "1": { + "name": "meta.embedded.math.markdown", + "patterns": [ + { + "include": "text.html.markdown.math#math" + } + ] + }, + "2": { + "name": "punctuation.definition.math.end.markdown" + } + }, + "patterns": [ + { + "begin": "(^|\\G)", + "while": "(^|\\G)(?!.*(\\${1}))", + "patterns": [ + { + "include": "text.html.markdown.math#math" + } + ] + } + ] + } + }, + "scopeName": "markdown.math.block" +} diff --git a/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json b/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json new file mode 100644 index 0000000000..02fe223665 --- /dev/null +++ b/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json @@ -0,0 +1,79 @@ +{ + "fileTypes": [], + "injectionSelector": "L:meta.paragraph.markdown - (comment, string, markup.math.inline.markdown, markup.fenced_code.block.markdown)", + "patterns": [ + { + "include": "#math_inline_double" + }, + { + "include": "#math_inline_single" + }, + { + "include": "#math_inline_block" + } + ], + "repository": { + "math_inline_single": { + "name": "markup.math.inline.markdown", + "match": "(?<=\\s|\\W|^)(?