mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Merge pull request #3804 from weedySeaDragon/bug/3803_vitepress-config-shiki-import-fix
bug: change shiki getHighlighter import
This commit is contained in:
commit
653682a4b8
@ -1,5 +1,7 @@
|
|||||||
import type { MarkdownRenderer } from 'vitepress';
|
import type { MarkdownRenderer } from 'vitepress';
|
||||||
import shiki from 'shiki';
|
|
||||||
|
// Note: using "import shiki from 'shiki' and then "const highlighter = await shiki.getHighlighter(...) does not work 2022-11-15
|
||||||
|
import { getHighlighter } from 'shiki';
|
||||||
|
|
||||||
const MermaidExample = async (md: MarkdownRenderer) => {
|
const MermaidExample = async (md: MarkdownRenderer) => {
|
||||||
const defaultRenderer = md.renderer.rules.fence;
|
const defaultRenderer = md.renderer.rules.fence;
|
||||||
@ -8,7 +10,7 @@ const MermaidExample = async (md: MarkdownRenderer) => {
|
|||||||
throw new Error('defaultRenderer is undefined');
|
throw new Error('defaultRenderer is undefined');
|
||||||
}
|
}
|
||||||
|
|
||||||
const highlighter = await shiki.getHighlighter({
|
const highlighter = await getHighlighter({
|
||||||
theme: 'material-palenight',
|
theme: 'material-palenight',
|
||||||
langs: ['mermaid'],
|
langs: ['mermaid'],
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user