solorice/vscode/extensions/yzhang.markdown-all-in-one-3.5.0/syntaxes/math_inline.markdown.tmLanguage.json
2022-04-28 20:54:44 +03:00

38 lines
1.5 KiB
JSON

{
"fileTypes": [],
"injectionSelector": "meta.paragraph.markdown - markup.inserted - meta.embedded",
"patterns": [
{
"include": "#math-inline"
}
],
"repository": {
"math-inline": {
"name": "markup.inserted.math.inline.markdown",
"begin": "(?x) #turn on extended mode\n (?<!^\\\\)(?<![^\\\\][\\$\\\\]) #without '$' and '\\' on the left\n (\\$) #a '$'\n (?![\\s\\$]) #without whitespace and '$' on the right\n (?=((?!\\s\\$).)* #not match ' $'\n (?<!\\\\)((\\\\{2})*(\\\\\\$)?)(?<!\\s)(\\$)(?![0-9]) #match the end '$'\n ) #ensure math closed\n",
"end": "(?x) #turn on extended mode\n (?<![^\\\\][\\$\\\\])(?<!\\s) #without '$' '\\' and whitespace on the left\n (\\$) #a '$'\n (?![0-9]) #without number on the right\n (?!((\\$)(?![\\s\\$])(?=((?!\\s\\$).)+((?<![^\\\\][\\$\\\\])(?<!\\s)(\\$)(?![0-9]))))) #without a begin '$' on the right\n",
"captures": {
"1": {
"name": "punctuation.definition.math.inline.markdown"
}
},
"contentName": "meta.embedded.block.katex",
"patterns": [
{
"name": "markup.inserted.math.inline.markdown",
"match": "(?<![^\\\\][\\$\\\\])(?<!\\s)(\\$\\$)",
"comment": "match a end '$' and a begin '$'",
"captures": {
"1": {
"name": "punctuation.definition.math.inline.markdown"
}
}
},
{
"include": "text.katex"
}
]
}
},
"scopeName": "markdown.math_inline"
}