Fix syntax highlighting of math in markdown lists

Fixes #128411
This commit is contained in:
Matt Bierner
2021-08-05 13:30:30 -07:00
parent dc54347a27
commit f8cc75937a
3 changed files with 583 additions and 6 deletions

View File

@@ -3,20 +3,22 @@
"injectionSelector": "L:text.html.markdown - (comment, string, meta.paragraph.markdown, markup.math.block.markdown, markup.fenced_code.block.markdown)",
"patterns": [
{
"include": "#math_block"
"include": "#double_quote_math_block"
},
{
"include": "#single_math_block"
}
],
"repository": {
"math_block": {
"double_quote_math_block": {
"name": "markup.math.block.markdown",
"contentName": "meta.embedded.math.markdown",
"begin": "(?<=(^|\\G)\\s*)(\\${1,2})(?=\\s*$)",
"begin": "(?<=(^|\\G)\\s*)(\\${2})(?=\\s*$)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.math.begin.markdown"
}
},
"end": "^\\s*(\\${1,2})\\s*$",
"end": "(\\${2})",
"endCaptures": {
"1": {
"name": "punctuation.definition.math.end.markdown"
@@ -24,7 +26,41 @@
},
"patterns": [
{
"include": "text.html.markdown.math#math"
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!.*(\\${2}))",
"contentName": "meta.embedded.math.markdown",
"patterns": [
{
"include": "text.html.markdown.math#math"
}
]
}
]
},
"single_quote_math_block": {
"name": "markup.math.block.markdown",
"begin": "(?<=(^|\\G)\\s*)(\\$)(?=\\s*$)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.math.begin.markdown"
}
},
"end": "(\\$)",
"endCaptures": {
"1": {
"name": "punctuation.definition.math.end.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!.*(\\$))",
"contentName": "meta.embedded.math.markdown",
"patterns": [
{
"include": "text.html.markdown.math#math"
}
]
}
]
}