-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Syntax highlight MDX code blocks in markdown files
This is based on https://github.com/tamasfe/taplo.
- Loading branch information
1 parent
160a201
commit 91f986f
Showing
3 changed files
with
60 additions
and
0 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 @@ | ||
--- | ||
'vscode-mdx': minor | ||
--- | ||
|
||
Syntax highlight MDX code blocks in markdown 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"fileTypes": [], | ||
"injectionSelector": "L:text.html.markdown", | ||
"patterns": [ | ||
{ | ||
"include": "#mdxCodeBlock" | ||
} | ||
], | ||
"repository": { | ||
"mdxCodeBlock": { | ||
"begin": "(^|\\G)(\\s*)(\\`{3,}|~{3,})\\s*(?i:(mdx)(\\s+[^`~]*)?$)", | ||
"name": "markup.fenced_code.block.markdown", | ||
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$", | ||
"beginCaptures": { | ||
"3": { | ||
"name": "punctuation.definition.markdown" | ||
}, | ||
"4": { | ||
"name": "fenced_code.block.language.markdown" | ||
}, | ||
"5": { | ||
"name": "fenced_code.block.language.attributes.markdown" | ||
} | ||
}, | ||
"endCaptures": { | ||
"3": { | ||
"name": "punctuation.definition.markdown" | ||
} | ||
}, | ||
"patterns": [ | ||
{ | ||
"begin": "(^|\\G)(\\s*)(.*)", | ||
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)", | ||
"contentName": "meta.embedded.block.mdx", | ||
"patterns": [ | ||
{ | ||
"include": "source.mdx" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
}, | ||
"scopeName": "source.markdown.mdx.codeblock" | ||
} |