Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: change shiki getHighlighter import #3804

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/mermaid/src/docs/.vitepress/mermaid-markdown-all.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
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 defaultRenderer = md.renderer.rules.fence;
Expand All @@ -8,7 +10,7 @@ const MermaidExample = async (md: MarkdownRenderer) => {
throw new Error('defaultRenderer is undefined');
}

const highlighter = await shiki.getHighlighter({
const highlighter = await getHighlighter({
theme: 'material-palenight',
langs: ['mermaid'],
});
Expand Down