Corrected the regex to detect espaced percent symbol (#139437)

This commit is contained in:
Khaled 2022-01-05 12:13:29 -08:00 committed by GitHub
parent bdb513f545
commit 0dba492e01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 1 deletions

View file

@ -14,7 +14,7 @@
"patterns": [
{
"name": "comment.line.math.tex",
"match": "(%)(.+)$",
"match": "((?<!\\\\)%)(.+)$",
"captures": {
"1": {
"name": "punctuation.definition.comment.math.tex"

View file

@ -167,3 +167,7 @@ $12.45
$12.45 x
x $12.45
<!-- Should not interpret text for skipped percent (\%) -->
$$ \% Should not be highlighted $$

View file

@ -6532,5 +6532,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 interpret text for skipped percent (\\%) ",
"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": "$$",
"t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown punctuation.definition.math.begin.markdown",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
},
{
"c": " \\% Should not be highlighted ",
"t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown meta.embedded.math.markdown",
"r": {
"dark_plus": "meta.embedded: #D4D4D4",
"light_plus": "meta.embedded: #000000",
"dark_vs": "meta.embedded: #D4D4D4",
"light_vs": "meta.embedded: #000000",
"hc_black": "meta.embedded: #FFFFFF"
}
},
{
"c": "$$",
"t": "text.html.markdown meta.paragraph.markdown markup.math.inline.markdown punctuation.definition.math.begin.markdown",
"r": {
"dark_plus": "default: #D4D4D4",
"light_plus": "default: #000000",
"dark_vs": "default: #D4D4D4",
"light_vs": "default: #000000",
"hc_black": "default: #FFFFFF"
}
}
]