Skip to content

Commit

Permalink
docs: remove unnecessary call to escapeSvelte
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored and pngwn committed Aug 17, 2024
1 parent 94a1c25 commit 175c256
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/site/src/routes/_docs.svtext
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ Frontmatter also interacts with layouts, you can find more details in the [Layou
You can use shiki for highlighting rather than prism by leveraging the `highlighter` option:

```js
import { mdsvex, escapeSvelte } from 'mdsvex';
import { mdsvex } from 'mdsvex';
import { createHighlighter } from 'shiki';

const theme = 'github-dark';
Expand All @@ -690,10 +690,7 @@ const highlighter = await createHighlighter({
/** @type {import('mdsvex').MdsvexOptions} */
const mdsvexOptions = {
highlight: {
highlighter: async (code, lang = 'text') => {
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme }));
return `{@html \\`${html}\\` }`;
}
highlighter: (code, lang = 'text') => highlighter.codeToHtml(code, { lang, theme })
},
}
```
Expand Down

0 comments on commit 175c256

Please sign in to comment.