Skip to content

Commit 1cc86bd

Browse files
SheetJSDevfarnabaz
andauthored
fix(shiki): issue with JSON import (#1824)
Co-authored-by: Farnabaz <[email protected]>
1 parent ee6eb99 commit 1cc86bd

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/runtime/transformers/shiki/highlighter.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { getHighlighter, BUNDLED_LANGUAGES, BUNDLED_THEMES, Lang, Theme as Shiki
22
import consola from 'consola'
33
import type { ModuleOptions } from '../../../module'
44
import { createSingleton } from '../utils'
5-
import mdcTMLanguage from './languages/mdc.tmLanguage.json'
5+
import mdcTMLanguage from './languages/mdc.tmLanguage'
66
import type { MarkdownNode, HighlighterOptions, Theme, HighlightThemedToken, HighlightThemedTokenLine, TokenColorMap } from './types'
77

88
// Re-create logger locally as utils cannot be imported from here

src/runtime/transformers/shiki/languages/mdc.tmLanguage.json src/runtime/transformers/shiki/languages/mdc.tmLanguage.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{
1+
/* eslint-disable */
2+
// see microsoft/vscode-textmate#185
3+
// import { IRawGrammar } from 'vscode-textmate/release/rawGrammar';
4+
5+
const grammar /*: IRawGrammar */ = {
26
"information_for_contributors": [
37
"This file has been converted from https://github.com/docusgen/vscode-extension/blob/main/syntaxes/mdc.tmLanguage.json",
48
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
@@ -64,7 +68,7 @@
6468
"include": "#markdown_attributes"
6569
}
6670
]
67-
},
71+
},
6872
"markdown_attributes": {
6973
"match": "(?x)([^ ])( # attributes\n ({)\n ([^{]*)\n (})\n )",
7074
"name": "markup.component.attribute",
@@ -570,4 +574,6 @@
570574
"while": "(^|\\G)\\s*(>) ?"
571575
}
572576
}
573-
}
577+
}
578+
579+
export default grammar;

0 commit comments

Comments
 (0)