Skip to content

Commit

Permalink
Simplify code highlighting configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
metaboulie committed Dec 27, 2024
1 parent 58b0669 commit 49b83e3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 4 additions & 4 deletions src/content/blog/post-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ MDSvex supports all standard Markdown features plus some extras:
- **Frontmatter** for metadata
- **Custom components** within Markdown

### Math Support
### Math Example

You can include mathematical equations using KaTeX or MathJax (once configured):
Here's a simple mathematical formula (rendered as plain text for now):

```math
f(x) = \int_{-\infty}^{\infty} \hat{f}(\xi) e^{2\pi i\xi x} d\xi
```plaintext
f(x) = sin(x) + cos(x)
```

## Conclusion
Expand Down
10 changes: 1 addition & 9 deletions svelte.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ const config = {
preprocess: [
vitePreprocess(),
mdsvex({
extensions: ['.md', '.svx'],
highlight: {
highlighter(code, lang = 'text') {
if (lang === 'math') {
return `<div class="math-block">${code}</div>`;
}
return `<pre class="language-${lang}"><code>${code}</code></pre>`;
}
}
extensions: ['.md', '.svx']
})
],

Expand Down

0 comments on commit 49b83e3

Please sign in to comment.