mirror of
https://github.com/dergigi/boris.git
synced 2026-02-17 21:15:02 +01:00
fix: prevent 'No readable content' flash for markdown articles
- Check for markdown/html existence before checking finalHtml - Show empty container while markdown is being converted to HTML - Fixes issue where nostr blog posts briefly showed error message
This commit is contained in:
@@ -183,12 +183,16 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{finalHtml ? (
|
||||
<div
|
||||
ref={contentRef}
|
||||
className={markdown ? "reader-markdown" : "reader-html"}
|
||||
dangerouslySetInnerHTML={{ __html: finalHtml }}
|
||||
/>
|
||||
{markdown || html ? (
|
||||
finalHtml ? (
|
||||
<div
|
||||
ref={contentRef}
|
||||
className={markdown ? "reader-markdown" : "reader-html"}
|
||||
dangerouslySetInnerHTML={{ __html: finalHtml }}
|
||||
/>
|
||||
) : (
|
||||
<div className="reader-markdown" ref={contentRef} />
|
||||
)
|
||||
) : (
|
||||
<div className="reader empty">
|
||||
<p>No readable content found for this URL.</p>
|
||||
|
||||
Reference in New Issue
Block a user