fix: Syntax highlight for `svelte` and `vue`
This commit is contained in:
parent
3287a41af9
commit
ccadd26024
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue