Highlight code in post

This commit is contained in:
2025-11-07 01:23:31 +08:00
parent 8f359fdff0
commit 1b676508db
3 changed files with 9 additions and 4 deletions

View File

@@ -1,11 +1,12 @@
import {
createMarkdownExit,
type PluginWithParams
} from "markdown-exit"
import { createMarkdownExit, type PluginWithParams } from "markdown-exit"
import hljs from "highlight.js"
import hljsMarkdown from "markdown-it-highlightjs"
// @ts-ignore
import texmath from "markdown-it-texmath"
import katex from "katex"
import "highlight.js/styles/a11y-dark.min.css"
export function useMarkdownProcessor() {
const serverUrl = useSolarNetworkUrl()
@@ -21,6 +22,7 @@ export function useMarkdownProcessor() {
delimiters: "dollars",
katexOptions: { macros: { "\\RR": "\\mathbb{R}" } }
})
.use(hljsMarkdown, { hljs })
.use(imgSolarNetworkPlugin, { serverUrl: serverUrl })
// Keep the empty lines