代码高亮优化

This commit is contained in:
mxd
2021-11-09 21:02:47 +08:00
parent 2b3c208e8b
commit 58b3a9924a

View File

@@ -9,10 +9,6 @@ export const HighLightOptions = {
tokenizer: {
root: [
[/\s+/, 'white'],
[
/```((?:\w|[\/\-#])+).*$/,
{ token: 'string', next: '@codeblockgh', nextEmbedded: '$1' }
],
[/```$/, { token: 'string', next: '@codeblock' }],
[/[a-zA-Z_$][\w$]*[\s]?/, {
cases: {
@@ -78,10 +74,6 @@ export const HighLightOptions = {
[/^```$/, { token: 'string', next: '@pop' }],
[/.*$/, 'variable.source']
],
codeblockgh: [
[/```\s*$/, { token: 'variable.source', next: '@pop', nextEmbedded: '@pop' }],
[/[^`]+/, 'variable.source']
],
regexrange: [
[/-/, 'regexp.escape.control'],
[/\^/, 'regexp.invalid'],