mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-19 10:54:06 -06:00
fix: pass mathjax macros to rehype correctly
This commit is contained in:
parent
c99c8070f2
commit
3e085b2b0b
@ -17,8 +17,10 @@ interface Options {
|
|||||||
typstOptions: TypstOptions
|
typstOptions: TypstOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// mathjax macros
|
||||||
|
export type Args = boolean | number | string | null
|
||||||
interface MacroType {
|
interface MacroType {
|
||||||
[key: string]: string
|
[key: string]: string | Args[]
|
||||||
}
|
}
|
||||||
|
|
||||||
export const Latex: QuartzTransformerPlugin<Partial<Options>> = (opts) => {
|
export const Latex: QuartzTransformerPlugin<Partial<Options>> = (opts) => {
|
||||||
@ -37,11 +39,20 @@ export const Latex: QuartzTransformerPlugin<Partial<Options>> = (opts) => {
|
|||||||
case "typst": {
|
case "typst": {
|
||||||
return [[rehypeTypst, opts?.typstOptions ?? {}]]
|
return [[rehypeTypst, opts?.typstOptions ?? {}]]
|
||||||
}
|
}
|
||||||
|
default:
|
||||||
case "mathjax": {
|
case "mathjax": {
|
||||||
return [[rehypeMathjax, { macros, ...(opts?.mathJaxOptions ?? {}) }]]
|
return [
|
||||||
}
|
[
|
||||||
default: {
|
rehypeMathjax,
|
||||||
return [[rehypeMathjax, { macros, ...(opts?.mathJaxOptions ?? {}) }]]
|
{
|
||||||
|
...(opts?.mathJaxOptions ?? {}),
|
||||||
|
tex: {
|
||||||
|
...(opts?.mathJaxOptions?.tex ?? {}),
|
||||||
|
macros,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user