Skip to content

Commit b7483ab

Browse files
committed
Update markdown grammar
1 parent 9d2f309 commit b7483ab

2 files changed

Lines changed: 71 additions & 3 deletions

File tree

extensions/markdown-basics/syntaxes/markdown.tmLanguage.json

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
55
"Once accepted there, we are happy to receive an update request."
66
],
7-
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/3445afdd642f67052a21c0f86bf76b3deb45fd26",
7+
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/2544443db4402b3271b1b99bd9a1efb2c757c3d5",
88
"name": "Markdown",
99
"scopeName": "text.html.markdown",
1010
"patterns": [
@@ -1948,7 +1948,7 @@
19481948
"name": "punctuation.definition.string.end.markdown"
19491949
}
19501950
},
1951-
"match": "(?x)\n \\s* # Leading whitespace\n (\\[)(.+?)(\\])(:) # Reference name\n [ \\t]* # Optional whitespace\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in quotes…\n | ((\").+?(\")) # or in parens.\n )? # Title is optional\n \\s* # Optional whitespace\n $\n",
1951+
"match": "(?x)\n \\s* # Leading whitespace\n (\\[)([\\w ]+?)(\\])(:) # Reference name\n [ \\t]* # Optional whitespace\n (<?)(\\S+?)(>?) # The url\n [ \\t]* # Optional whitespace\n (?:\n ((\\().+?(\\))) # Match title in quotes…\n | ((\").+?(\")) # or in parens.\n )? # Title is optional\n \\s* # Optional whitespace\n $\n",
19521952
"name": "meta.link.reference.def.markdown"
19531953
},
19541954
"list_paragraph": {
@@ -2085,6 +2085,9 @@
20852085
},
20862086
{
20872087
"include": "#link-ref-literal"
2088+
},
2089+
{
2090+
"include": "#link-ref-shortcut"
20882091
}
20892092
],
20902093
"repository": {
@@ -2151,6 +2154,9 @@
21512154
},
21522155
{
21532156
"include": "#link-ref"
2157+
},
2158+
{
2159+
"include": "#link-ref-shortcut"
21542160
}
21552161
]
21562162
},
@@ -2290,6 +2296,9 @@
22902296
},
22912297
{
22922298
"include": "#link-ref"
2299+
},
2300+
{
2301+
"include": "#link-ref-shortcut"
22932302
}
22942303
]
22952304
},
@@ -2416,6 +2425,21 @@
24162425
"match": "(\\[)((?<square>[^\\[\\]\\\\]|\\\\.|\\[\\g<square>*+\\])*+)(\\])[ ]?(\\[)(\\])",
24172426
"name": "meta.link.reference.literal.markdown"
24182427
},
2428+
"link-ref-shortcut": {
2429+
"captures": {
2430+
"1": {
2431+
"name": "punctuation.definition.string.begin.markdown"
2432+
},
2433+
"2": {
2434+
"name": "string.other.link.title.markdown"
2435+
},
2436+
"4": {
2437+
"name": "punctuation.definition.string.end.markdown"
2438+
}
2439+
},
2440+
"match": "(\\[)(\\S+?)(\\])",
2441+
"name": "meta.link.reference.markdown"
2442+
},
24192443
"raw": {
24202444
"captures": {
24212445
"1": {

extensions/markdown-basics/test/colorize-results/test_md.json

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2486,7 +2486,51 @@
24862486
}
24872487
},
24882488
{
2489-
"c": "*[ABBR]: Markdown plus abbreviations (produces an ",
2489+
"c": "*",
2490+
"t": "text.html.markdown meta.paragraph.markdown",
2491+
"r": {
2492+
"dark_plus": "default: #D4D4D4",
2493+
"light_plus": "default: #000000",
2494+
"dark_vs": "default: #D4D4D4",
2495+
"light_vs": "default: #000000",
2496+
"hc_black": "default: #FFFFFF"
2497+
}
2498+
},
2499+
{
2500+
"c": "[",
2501+
"t": "text.html.markdown meta.paragraph.markdown meta.link.reference.markdown punctuation.definition.string.begin.markdown",
2502+
"r": {
2503+
"dark_plus": "default: #D4D4D4",
2504+
"light_plus": "default: #000000",
2505+
"dark_vs": "default: #D4D4D4",
2506+
"light_vs": "default: #000000",
2507+
"hc_black": "default: #FFFFFF"
2508+
}
2509+
},
2510+
{
2511+
"c": "ABBR",
2512+
"t": "text.html.markdown meta.paragraph.markdown meta.link.reference.markdown string.other.link.title.markdown",
2513+
"r": {
2514+
"dark_plus": "string: #CE9178",
2515+
"light_plus": "string: #A31515",
2516+
"dark_vs": "string: #CE9178",
2517+
"light_vs": "string: #A31515",
2518+
"hc_black": "string: #CE9178"
2519+
}
2520+
},
2521+
{
2522+
"c": "]",
2523+
"t": "text.html.markdown meta.paragraph.markdown meta.link.reference.markdown",
2524+
"r": {
2525+
"dark_plus": "default: #D4D4D4",
2526+
"light_plus": "default: #000000",
2527+
"dark_vs": "default: #D4D4D4",
2528+
"light_vs": "default: #000000",
2529+
"hc_black": "default: #FFFFFF"
2530+
}
2531+
},
2532+
{
2533+
"c": ": Markdown plus abbreviations (produces an ",
24902534
"t": "text.html.markdown meta.paragraph.markdown",
24912535
"r": {
24922536
"dark_plus": "default: #D4D4D4",

0 commit comments

Comments
 (0)