diff options
Diffstat (limited to 'mdsvex.config.js')
| -rw-r--r-- | mdsvex.config.js | 37 |
1 files changed, 24 insertions, 13 deletions
diff --git a/mdsvex.config.js b/mdsvex.config.js index 7476259..01e0da4 100644 --- a/mdsvex.config.js +++ b/mdsvex.config.js @@ -1,22 +1,33 @@ -import { createHighlighter } from 'shiki'; +import { createHighlighter } from "shiki"; const highlighter = await createHighlighter({ - themes: ['ayu-dark'], - langs: ['javascript', 'typescript', 'svelte', 'html', 'css', 'bash', 'json', 'yaml', 'markdown', 'python'] + themes: ["ayu-dark"], + langs: [ + "javascript", + "typescript", + "svelte", + "html", + "css", + "bash", + "json", + "yaml", + "markdown", + "python", + ], }); /** @type {import('mdsvex').MdsvexOptions} */ const mdsvexConfig = { - extensions: ['.svx'], - highlight: { - highlighter: async (code, lang) => { - const html = highlighter.codeToHtml(code, { - lang: lang || 'text', - theme: 'ayu-dark' - }); - return `{@html \`${html.replace(/[{}`]/g, (c) => `&#${c.charCodeAt(0)};`)}\`}`; - } - } + extensions: [".svx"], + highlight: { + highlighter: async (code, lang) => { + const html = highlighter.codeToHtml(code, { + lang: lang || "text", + theme: "ayu-dark", + }); + return `{@html \`${html.replace(/[{}`]/g, (c) => `&#${c.charCodeAt(0)};`)}\`}`; + }, + }, }; export default mdsvexConfig; |
