From b9c770e63da37f3a33e46c69a09f21b4b8d6ad8b Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 19 Apr 2022 17:20:20 +0800 Subject: ... --- FrontEnd/src/views/timeline/TimelinePostContentView.tsx | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'FrontEnd/src/views/timeline/TimelinePostContentView.tsx') diff --git a/FrontEnd/src/views/timeline/TimelinePostContentView.tsx b/FrontEnd/src/views/timeline/TimelinePostContentView.tsx index 88cd756a..9e50e5cb 100644 --- a/FrontEnd/src/views/timeline/TimelinePostContentView.tsx +++ b/FrontEnd/src/views/timeline/TimelinePostContentView.tsx @@ -1,6 +1,6 @@ import React from "react"; import classnames from "classnames"; -import { Remarkable } from "remarkable"; +import { marked } from "marked"; import { UiLogicError } from "@/common"; @@ -88,17 +88,6 @@ const ImageView: React.FC = (props) => { const MarkdownView: React.FC = (props) => { const { post, className, style } = props; - const _remarkable = React.useRef(); - - const getRemarkable = (): Remarkable => { - if (_remarkable.current) { - return _remarkable.current; - } else { - _remarkable.current = new Remarkable(); - return _remarkable.current; - } - }; - const [markdown, setMarkdown] = React.useState(null); const [error, setError] = React.useState<"offline" | "error" | null>(null); @@ -134,7 +123,7 @@ const MarkdownView: React.FC = (props) => { const markdownHtml = React.useMemo(() => { if (markdown == null) return null; - return getRemarkable().render(markdown); + return marked.parse(markdown); }, [markdown]); if (error != null) { -- cgit v1.2.3