-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Update Astro syntax highlighting for MDX files (#950)
* fix: Update Astro syntax highlighting for MDX files * add changeset
- Loading branch information
1 parent
af5bbc5
commit 572e9cb
Showing
3 changed files
with
45 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"astro-vscode": patch | ||
--- | ||
|
||
Fix Astro codeblock syntax highlighting for MDX files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,61 @@ | ||
{ | ||
"fileTypes": [], | ||
"scopeName": "text.mdx.astro.codeblock", | ||
"scopeName": "source.mdx.astro", | ||
"injectionSelector": "L:source.mdx", | ||
"patterns": [ | ||
{ | ||
"begin": "(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:(?:.*\\.)?astro))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "string.other.begin.code.fenced.mdx" | ||
}, | ||
"2": { | ||
"name": "entity.name.function.mdx" | ||
} | ||
}, | ||
"contentName": "meta.embedded.astro", | ||
"end": "(\\1)(?:[\\t ]*$)", | ||
"endCaptures": { | ||
"1": { | ||
"name": "string.other.end.code.fenced.mdx" | ||
} | ||
}, | ||
"name": "markup.code.astro.mdx", | ||
"patterns": [ | ||
{ | ||
"include": "#astro-code-block" | ||
} | ||
] | ||
}, | ||
{ | ||
"begin": "(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:(?:.*\\.)?astro))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)", | ||
"include": "#mdx_fenced_code_block_astro" | ||
} | ||
], | ||
"repository": { | ||
"mdx_fenced_code_block_astro": { | ||
"begin": "(?:^|\\G)[\\t ]*([`~]{3,})(?:[\\t ]*((?:astro|(?:.*\\.)?(?:astro)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)", | ||
"beginCaptures": { | ||
"1": { | ||
"name": "string.other.begin.code.fenced.mdx" | ||
"name": "punctuation.definition.markdown" | ||
}, | ||
"2": { | ||
"name": "entity.name.function.mdx" | ||
"name": "entity.name.function.markdown" | ||
} | ||
}, | ||
"contentName": "meta.embedded.astro", | ||
"end": "(\\1)(?:[\\t ]*$)", | ||
"end": "(^\\1)\\s*$", | ||
"endCaptures": { | ||
"1": { | ||
"name": "string.other.end.code.fenced.mdx" | ||
"3": { | ||
"name": "punctuation.definition.markdown" | ||
} | ||
}, | ||
"name": "markup.code.astro.mdx", | ||
"patterns": [ | ||
{ | ||
"include": "#astro-code-block" | ||
} | ||
] | ||
} | ||
], | ||
"repository": { | ||
"astro-code-block": { | ||
"patterns": [ | ||
{ | ||
"begin": "^\\s*---\\s*$", | ||
"end": "^\\s*---\\s*$", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.tag.xi.begin.t" | ||
} | ||
}, | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.tag.xi.end.t" | ||
} | ||
}, | ||
"contentName": "meta.embedded.block.astro.frontmatter", | ||
"begin": "(^|\\G)(\\s*)(.*)", | ||
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", | ||
"patterns": [ | ||
{ | ||
"include": "source.tsx" | ||
"begin": "^\\s*---\\s*$", | ||
"end": "^\\s*---\\s*$", | ||
"beginCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.tag.xi.begin.t" | ||
} | ||
}, | ||
"endCaptures": { | ||
"0": { | ||
"name": "punctuation.definition.tag.xi.end.t" | ||
} | ||
}, | ||
"contentName": "mdx.embedded.astro.frontmatter", | ||
"patterns": [ | ||
{ | ||
"include": "source.tsx" | ||
} | ||
] | ||
}, | ||
{ | ||
"contentName": "mdx.embedded.astro", | ||
"include": "source.astro" | ||
} | ||
] | ||
}, | ||
{ | ||
"include": "source.astro" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} |