Skip to content

Commit

Permalink
chore: Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
mattcroat committed Feb 10, 2024
1 parent b965255 commit 6728ed2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/routes/[slug]/+page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ export async function load({ params }) {
meta: post.metadata
}
} catch (e) {
throw error(404, `Could not find ${params.slug}`)
error(404, `Could not find ${params.slug}`)
}
}
16 changes: 8 additions & 8 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import adapter from '@sveltejs/adapter-vercel'
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'

import { mdsvex, escapeSvelte } from 'mdsvex'
import {getHighlighter } from 'shiki'
import { getHighlighter } from 'shiki'
import remarkUnwrapImages from 'remark-unwrap-images'
import remarkToc from 'remark-toc'
import rehypeSlug from 'rehype-slug'
Expand All @@ -15,13 +15,13 @@ const mdsvexOptions = {
},
highlight: {
highlighter: async (code, lang = 'text') => {
const highlighter = await getHighlighter({
themes: ['poimandres'],
langs: ['javascript', 'typescript']
});
await highlighter.loadLanguage('javascript', 'typescript');
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'poimandres' }));
return `{@html \`${html}\` }`;
const highlighter = await getHighlighter({
themes: ['poimandres'],
langs: ['javascript', 'typescript']
})
await highlighter.loadLanguage('javascript', 'typescript')
const html = escapeSvelte(highlighter.codeToHtml(code, { lang, theme: 'poimandres' }))
return `{@html \`${html}\` }`
}
},
remarkPlugins: [remarkUnwrapImages, [remarkToc, { tight: true }]],
Expand Down

0 comments on commit 6728ed2

Please sign in to comment.