mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 17:11:55 +00:00
feat: add more validation to KaTeX in markdown
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import "katex/dist/katex.min.css";
|
||||
import rehypeKatex from "rehype-katex";
|
||||
import rehypePrism from "rehype-prism";
|
||||
import rehypeReact from "rehype-react";
|
||||
import remarkBreaks from "remark-breaks";
|
||||
@@ -14,6 +13,9 @@ import { createElement } from "preact";
|
||||
import { memo } from "preact/compat";
|
||||
import { useLayoutEffect, useMemo, useState } from "preact/hooks";
|
||||
|
||||
// @ts-expect-error no typings
|
||||
import rehypeKatex from "@revoltchat/rehype-katex";
|
||||
|
||||
import { MarkdownProps } from "./Markdown";
|
||||
import { handlers } from "./hast";
|
||||
import { RenderCodeblock } from "./plugins/Codeblock";
|
||||
@@ -146,6 +148,7 @@ const render = unified()
|
||||
.use(rehypeKatex, {
|
||||
maxSize: 10,
|
||||
maxExpand: 0,
|
||||
maxLength: 128,
|
||||
trust: false,
|
||||
strict: false,
|
||||
output: "html",
|
||||
|
||||
Reference in New Issue
Block a user