feat(update-viewer): support rendering HTML in update markdown #5932

Closes #5932
This commit is contained in:
Slinetrac
2025-12-23 20:48:14 +08:00
parent be6b53c760
commit 0992556b4a
4 changed files with 112 additions and 0 deletions
@@ -7,6 +7,7 @@ import type { Ref } from "react";
import { useImperativeHandle, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
import ReactMarkdown from "react-markdown";
import rehypeRaw from "rehype-raw";
import useSWR from "swr";
import { BaseDialog, DialogRef } from "@/components/base";
@@ -144,6 +145,7 @@ export function UpdateViewer({ ref }: { ref?: Ref<DialogRef> }) {
>
<Box sx={{ height: "calc(100% - 10px)", overflow: "auto" }}>
<ReactMarkdown
rehypePlugins={[rehypeRaw]}
components={{
a: ({ ...props }) => {
const { children } = props;