From 4c59240e6383f34c777247fd14ceed1ec38afe29 Mon Sep 17 00:00:00 2001 From: Imken Luo Date: Fri, 20 Oct 2023 23:58:02 +0800 Subject: [PATCH] fix: markdown rendering --- packages/viewer/package.json | 2 + packages/viewer/src/app/layout.tsx | 4 +- .../viewer/src/components/replies/Content.tsx | 59 ++++++++++--------- pnpm-lock.yaml | 45 ++++++++++++++ 4 files changed, 81 insertions(+), 29 deletions(-) diff --git a/packages/viewer/package.json b/packages/viewer/package.json index 5aedb4b..25d4909 100644 --- a/packages/viewer/package.json +++ b/packages/viewer/package.json @@ -22,8 +22,10 @@ "react-icons": "^4.11.0", "react-infinite-scroll-component": "^6.1.0", "react-markdown": "^9.0.0", + "rehype-highlight": "^7.0.0", "rehype-katex": "^7.0.0", "remark-gfm": "^4.0.0", + "remark-luogu-flavor": "^1.0.0", "remark-math": "^6.0.0", "socket.io-client": "^4.7.2", "swr": "^2.2.2" diff --git a/packages/viewer/src/app/layout.tsx b/packages/viewer/src/app/layout.tsx index 3219b33..56e7505 100644 --- a/packages/viewer/src/app/layout.tsx +++ b/packages/viewer/src/app/layout.tsx @@ -29,7 +29,7 @@ export default function RootLayout({ children }: React.PropsWithChildren) { )}
-
@@ -42,7 +42,7 @@ export default function RootLayout({ children }: React.PropsWithChildren) { 升级了讨论区 ,暂未完成相关适配。 -
+
*/} {children}