Skip to content

Commit

Permalink
Prevent <Markdown> blocks from locking up vscode extension (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and ewatch committed May 31, 2021
1 parent ab53bd9 commit 5929ee8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 56 deletions.
36 changes: 0 additions & 36 deletions tools/astro-vscode/syntaxes/astro-markdown.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2200,42 +2200,6 @@
"end": "(-->)",
"name": "comment.block.html"
},
{
"begin": "(?i)(^|\\G)\\s*(?=<(script|style|pre)(\\s|$|>)(?!.*?</(script|style|pre)>))",
"end": "(?i)(.*)((</)(script|style|pre)(>))",
"endCaptures": {
"1": {
"patterns": [
{
"include": "text.html.markdown.astro"
}
]
},
"2": {
"name": "meta.tag.structure.$4.end.html"
},
"3": {
"name": "punctuation.definition.tag.begin.html"
},
"4": {
"name": "entity.name.tag.html"
},
"5": {
"name": "punctuation.definition.tag.end.html"
}
},
"patterns": [
{
"begin": "(\\s*|$)",
"patterns": [
{
"include": "text.html.markdown.astro"
}
],
"while": "(?i)^(?!.*</(script|style|pre|Markdown)>)"
}
]
},
{
"begin": "(?i)(?=</?[a-zA-Z]+[^\\s/&gt;]*(\\s|$|/?>))",
"while": "(?i)^(?!.*</(\\1||\\2)>)",
Expand Down
35 changes: 15 additions & 20 deletions tools/astro-vscode/syntaxes/astro.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -714,39 +714,34 @@
]
},
"astro-markdown": {
"begin": "(?:^\\s+)?(<)(Markdown)\\b(?=[^>]*)",
"name": "text.html.astro.markdown",
"begin": "(<)(Markdown)(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
"name":"punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.markdown.astro"
"name": "entity.name.tag.html"
},
"3": {
"name":"punctuation.definition.tag.end.html"
}
},
"end": "(</)(Markdown)(>)",
"endCaptures": {
"1": {
"name":"punctuation.definition.tag.begin.html"
},
"2": {
"name": "punctuation.definition.tag.html"
"name": "entity.name.tag.html"
},
"3": {
"name":"punctuation.definition.tag.end.html"
}
},
"name": "text.html.markdown.astro",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(?=</Markdown)",
"patterns": [
{
"include": "text.html.markdown.astro"
}
]
"include": "text.html.markdown.astro"
}
]
},
Expand Down

0 comments on commit 5929ee8

Please sign in to comment.