vscode/extensions/markdown-math/syntaxes/md-math-inline.tmLanguage.json
robincaloudis 63b07dbd7f
Fix wrong language scope in markdown inline math expression (#172957)
Let 3rd matching group be an end

Previously, the first and third group was
defined as beginning. This is not
true as the first group of the regular
expression is the beginning of the math
inline markdown expression and the third
group the _end_. Once the third group is
correctly assigned, its language scope can
be changed accordingly.
2023-02-01 06:44:37 -08:00

80 lines
1.7 KiB
JSON

{
"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|^)(?<!\\$)(\\$)(.+?)(\\$)(?!\\$)(?=\\s|\\W|$)",
"captures": {
"1": {
"name": "punctuation.definition.math.begin.markdown"
},
"2": {
"name": "meta.embedded.math.markdown",
"patterns": [
{
"include": "text.html.markdown.math#math"
}
]
},
"3": {
"name": "punctuation.definition.math.end.markdown"
}
}
},
"math_inline_double": {
"name": "markup.math.inline.markdown",
"match": "(?<=\\s|\\W|^)(?<!\\$)(\\$\\$)(.+?)(\\$\\$)(?!\\$)(?=\\s|\\W|$)",
"captures": {
"1": {
"name": "punctuation.definition.math.begin.markdown"
},
"2": {
"name": "meta.embedded.math.markdown",
"patterns": [
{
"include": "text.html.markdown.math#math"
}
]
},
"3": {
"name": "punctuation.definition.math.end.markdown"
}
}
},
"math_inline_block": {
"name": "markup.math.inline.markdown",
"contentName": "meta.embedded.math.markdown",
"begin": "(?<=\\s|^)(\\${2})",
"beginCaptures": {
"2": {
"name": "punctuation.definition.math.begin.markdown"
}
},
"end": "(\\${2})(?=\\s|$)",
"endCaptures": {
"2": {
"name": "punctuation.definition.math.end.markdown"
}
},
"patterns": [
{
"include": "text.html.markdown.math#math"
}
]
}
},
"scopeName": "markdown.math.inline"
}