Skip to content

Commit e486375

Browse files
committed
Update markdown grammar
1 parent c75f9bb commit e486375

2 files changed

Lines changed: 39 additions & 18 deletions

File tree

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

Lines changed: 29 additions & 8 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/a595d8ba2ae9ce8864435d33db2afa0fe68b1487",
7+
"version": "https://github.com/microsoft/vscode-markdown-tm-grammar/commit/05ccfa3db6edbd357390431f9e316adb38ba41d8",
88
"name": "Markdown",
99
"scopeName": "text.html.markdown",
1010
"patterns": [
@@ -716,7 +716,7 @@
716716
{
717717
"begin": "(^|\\G)(\\s*)(.*)",
718718
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
719-
"contentName": "meta.embedded.block.cpp source.cpp",
719+
"contentName": "meta.embedded.block.cpp",
720720
"patterns": [
721721
{
722722
"include": "source.cpp"
@@ -1987,8 +1987,29 @@
19871987
"name": "comment.block.html"
19881988
},
19891989
{
1990-
"begin": "(^|\\G)\\s*(?=<(script|style|pre)(\\s|$|>)(?!.*?</(script|style|pre)>))",
1991-
"end": "(?=.*</(script|style|pre)>)",
1990+
"begin": "(?i)(^|\\G)\\s*(?=<(script|style|pre)(\\s|$|>)(?!.*?</(script|style|pre)>))",
1991+
"end": "(?i)(.*)((</)(script|style|pre)(>))",
1992+
"endCaptures": {
1993+
"1": {
1994+
"patterns": [
1995+
{
1996+
"include": "text.html.basic"
1997+
}
1998+
]
1999+
},
2000+
"2": {
2001+
"name": "meta.tag.structure.$4.end.html"
2002+
},
2003+
"3": {
2004+
"name": "punctuation.definition.tag.begin.html"
2005+
},
2006+
"4": {
2007+
"name": "entity.name.tag.html"
2008+
},
2009+
"5": {
2010+
"name": "punctuation.definition.tag.end.html"
2011+
}
2012+
},
19922013
"patterns": [
19932014
{
19942015
"begin": "(\\s*|$)",
@@ -1997,12 +2018,12 @@
19972018
"include": "text.html.basic"
19982019
}
19992020
],
2000-
"while": "^(?!.*</(script|style|pre)>)"
2021+
"while": "(?i)^(?!.*</(script|style|pre)>)"
20012022
}
20022023
]
20032024
},
20042025
{
2005-
"begin": "(^|\\G)\\s*(?=</?(address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(\\s|$|/?>))",
2026+
"begin": "(?i)(^|\\G)\\s*(?=</?(address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(\\s|$|/?>))",
20062027
"patterns": [
20072028
{
20082029
"include": "text.html.basic"
@@ -2275,7 +2296,7 @@
22752296
},
22762297
"bracket": {
22772298
"comment": "Markdown will convert this for us. We match it so that the HTML grammar will not mark it up as invalid.",
2278-
"match": "<(?![a-z/?\\$!])",
2299+
"match": "<(?![a-zA-Z/?\\$!])",
22792300
"name": "meta.other.valid-bracket.markdown"
22802301
},
22812302
"escape": {
@@ -2566,4 +2587,4 @@
25662587
"name": "markup.inline.raw.string.markdown"
25672588
}
25682589
}
2569-
}
2590+
}

extensions/markdown-basics/test/colorize-results/test-33886_md.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
},
112112
{
113113
"c": "</",
114-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.inline.code.end.html punctuation.definition.tag.begin.html",
114+
"t": "text.html.markdown meta.tag.inline.code.end.html punctuation.definition.tag.begin.html",
115115
"r": {
116116
"dark_plus": "punctuation.definition.tag: #808080",
117117
"light_plus": "punctuation.definition.tag: #800000",
@@ -122,7 +122,7 @@
122122
},
123123
{
124124
"c": "code",
125-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.inline.code.end.html entity.name.tag.html",
125+
"t": "text.html.markdown meta.tag.inline.code.end.html entity.name.tag.html",
126126
"r": {
127127
"dark_plus": "entity.name.tag: #569CD6",
128128
"light_plus": "entity.name.tag: #800000",
@@ -133,7 +133,7 @@
133133
},
134134
{
135135
"c": ">",
136-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.inline.code.end.html punctuation.definition.tag.end.html",
136+
"t": "text.html.markdown meta.tag.inline.code.end.html punctuation.definition.tag.end.html",
137137
"r": {
138138
"dark_plus": "punctuation.definition.tag: #808080",
139139
"light_plus": "punctuation.definition.tag: #800000",
@@ -144,7 +144,7 @@
144144
},
145145
{
146146
"c": "</",
147-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.begin.html",
147+
"t": "text.html.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.begin.html",
148148
"r": {
149149
"dark_plus": "punctuation.definition.tag: #808080",
150150
"light_plus": "punctuation.definition.tag: #800000",
@@ -155,7 +155,7 @@
155155
},
156156
{
157157
"c": "pre",
158-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.structure.pre.end.html entity.name.tag.html",
158+
"t": "text.html.markdown meta.tag.structure.pre.end.html entity.name.tag.html",
159159
"r": {
160160
"dark_plus": "entity.name.tag: #569CD6",
161161
"light_plus": "entity.name.tag: #800000",
@@ -166,7 +166,7 @@
166166
},
167167
{
168168
"c": ">",
169-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.end.html",
169+
"t": "text.html.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.end.html",
170170
"r": {
171171
"dark_plus": "punctuation.definition.tag: #808080",
172172
"light_plus": "punctuation.definition.tag: #800000",
@@ -254,7 +254,7 @@
254254
},
255255
{
256256
"c": "a",
257-
"t": "text.html.markdown meta.paragraph.markdown",
257+
"t": "text.html.markdown",
258258
"r": {
259259
"dark_plus": "default: #D4D4D4",
260260
"light_plus": "default: #000000",
@@ -265,7 +265,7 @@
265265
},
266266
{
267267
"c": "</",
268-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.begin.html",
268+
"t": "text.html.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.begin.html",
269269
"r": {
270270
"dark_plus": "punctuation.definition.tag: #808080",
271271
"light_plus": "punctuation.definition.tag: #800000",
@@ -276,7 +276,7 @@
276276
},
277277
{
278278
"c": "pre",
279-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.structure.pre.end.html entity.name.tag.html",
279+
"t": "text.html.markdown meta.tag.structure.pre.end.html entity.name.tag.html",
280280
"r": {
281281
"dark_plus": "entity.name.tag: #569CD6",
282282
"light_plus": "entity.name.tag: #800000",
@@ -287,7 +287,7 @@
287287
},
288288
{
289289
"c": ">",
290-
"t": "text.html.markdown meta.paragraph.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.end.html",
290+
"t": "text.html.markdown meta.tag.structure.pre.end.html punctuation.definition.tag.end.html",
291291
"r": {
292292
"dark_plus": "punctuation.definition.tag: #808080",
293293
"light_plus": "punctuation.definition.tag: #800000",

0 commit comments

Comments
 (0)