fix: Syntax highlight for `svelte` and `vue`

This commit is contained in:
Aleksander Grygier 2026-02-07 02:50:18 +01:00
parent 3287a41af9
commit ccadd26024
1 changed files with 4 additions and 1 deletions

View File

@ -25,6 +25,7 @@
BOOL_TRUE_STRING BOOL_TRUE_STRING
} from '$lib/constants/markdown'; } from '$lib/constants/markdown';
import { UrlPrefix } from '$lib/enums'; import { UrlPrefix } from '$lib/enums';
import { FileTypeText } from '$lib/enums/files';
import { import {
highlightCode, highlightCode,
detectIncompleteCodeBlock, detectIncompleteCodeBlock,
@ -94,7 +95,9 @@
} }
return proc return proc
.use(rehypeHighlight) // Add syntax highlighting .use(rehypeHighlight, {
aliases: { [FileTypeText.XML]: [FileTypeText.SVELTE, FileTypeText.VUE] }
}) // Add syntax highlighting
.use(rehypeRestoreTableHtml) // Restore limited HTML (e.g., <br>, <ul>) inside Markdown tables .use(rehypeRestoreTableHtml) // Restore limited HTML (e.g., <br>, <ul>) inside Markdown tables
.use(rehypeEnhanceLinks) // Add target="_blank" to links .use(rehypeEnhanceLinks) // Add target="_blank" to links
.use(rehypeEnhanceCodeBlocks) // Wrap code blocks with header and actions .use(rehypeEnhanceCodeBlocks) // Wrap code blocks with header and actions