Skip to content

docs: fix markdown-it and rehype examples #956

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/packages/markdown-it.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ By default, the full bundle of `shiki` will be imported. If you are using a [fin
import { fromHighlighter } from '@shikijs/markdown-it/core'
import MarkdownIt from 'markdown-it'
import { createHighlighterCore } from 'shiki/core'
import { createOnigurumaEngine } from 'shiki/engine/oniguruma'

const highlighter = await createHighlighterCore({
themes: [
Expand All @@ -59,7 +60,7 @@ const highlighter = await createHighlighterCore({
langs: [
import('@shikijs/langs/javascript'),
],
loadWasm: import('shiki/wasm')
engine: createOnigurumaEngine(() => import('shiki/wasm'))
})

const md = MarkdownIt()
Expand Down
3 changes: 2 additions & 1 deletion docs/packages/rehype.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ import rehypeStringify from 'rehype-stringify'
import remarkParse from 'remark-parse'
import remarkRehype from 'remark-rehype'
import { createHighlighterCore } from 'shiki/core'
import { createOnigurumaEngine } from 'shiki/engine/oniguruma'

import { unified } from 'unified'

Expand All @@ -77,7 +78,7 @@ const highlighter = await createHighlighterCore({
langs: [
import('@shikijs/langs/javascript'),
],
loadWasm: import('shiki/wasm')
engine: createOnigurumaEngine(() => import('shiki/wasm'))
})

const raw = await fs.readFile('./input.md')
Expand Down