Fix highlighting of dollar amount at start of line in md files

Fixes #136535
This commit is contained in:
Matt Bierner 2021-11-08 17:53:52 -08:00
parent 0eee604f01
commit b614fb5db8
No known key found for this signature in database
GPG key ID: 099C331567E11888
3 changed files with 77 additions and 3 deletions

View file

@ -48,7 +48,7 @@
"single_dollar_math_block": {
"name": "markup.math.block.markdown",
"contentName": "meta.embedded.math.markdown",
"begin": "(?<=^\\s*)(\\${1})(?![^$]*\\${1})",
"begin": "(?<=^\\s*)(\\$)(?![^$]*\\$|\\d)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.math.begin.markdown"

View file

@ -152,10 +152,18 @@ a **b**
$$
**b**
<!-- Should allow inline code to be followed by non word character #136584 -->
<!-- Should allow inline code to be followed by non word character #136584 -->
Should be highlighted $\frac{1}{2}$.
Should not be highlighted $\frac{1}{2}$text
Should not be highlighted $\frac{1}{2}$10
<!-- Should not highlight dollar amount at start of line #136535 -->
$12.45
$12.45 x
x $12.45

View file

@ -6292,7 +6292,7 @@
}
},
{
"c": " Should allow inline code to be followed by non word character #136584 ",
"c": " Should allow inline code to be followed by non word character #136584 ",
"t": "text.html.markdown comment.block.html",
"r": {
"dark_plus": "comment: #6A9955",
@ -6466,5 +6466,71 @@
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "<!--",
"t": "text.html.markdown comment.block.html punctuation.definition.comment.html",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": " Should not highlight dollar amount at start of line #136535 ",
"t": "text.html.markdown comment.block.html",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "-->",
"t": "text.html.markdown comment.block.html punctuation.definition.comment.html",
"r": {
"dark_plus": "comment: #6A9955",
"light_plus": "comment: #008000",
"dark_vs": "comment: #6A9955",
"light_vs": "comment: #008000",
"hc_black": "comment: #7CA668"
}
},
{
"c": "$12.45",
"t": "text.html.markdown meta.paragraph.markdown",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "$12.45 x",
"t": "text.html.markdown meta.paragraph.markdown",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": "x $12.45",
"t": "text.html.markdown meta.paragraph.markdown",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
}
]