fix: show markdown content immediately when finalHtml is empty

- Render markdown directly with ReactMarkdown when finalHtml is not ready yet
- Prevents empty content display while markdown is being converted to HTML
- Fixes issue where default article text doesn't show
This commit is contained in:
Gigi
2025-10-05 19:06:53 +01:00
parent 560a4a6785
commit 8e0970b717

View File

@@ -190,8 +190,17 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
className={markdown ? "reader-markdown" : "reader-html"}
dangerouslySetInnerHTML={{ __html: finalHtml }}
/>
) : markdown ? (
<div
ref={contentRef}
className="reader-markdown"
>
<ReactMarkdown remarkPlugins={[remarkGfm]}>
{markdown}
</ReactMarkdown>
</div>
) : (
<div className="reader-markdown" ref={contentRef} />
<div className="reader-html" ref={contentRef} />
)
) : (
<div className="reader empty">