fix: ensure highlights are shown for markdown content

- Only show raw ReactMarkdown when there are no highlights
- Wait for finalHtml (with highlights) when highlights are present
- Prevents highlights from being bypassed during markdown conversion
This commit is contained in:
Gigi
2025-10-05 20:01:41 +01:00
parent 8f1e5e1082
commit 7f95eae405

View File

@@ -190,7 +190,7 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
className={markdown ? "reader-markdown" : "reader-html"}
dangerouslySetInnerHTML={{ __html: finalHtml }}
/>
) : markdown ? (
) : markdown && relevantHighlights.length === 0 ? (
<div
ref={contentRef}
className="reader-markdown"
@@ -200,7 +200,7 @@ const ContentPanel: React.FC<ContentPanelProps> = ({
</ReactMarkdown>
</div>
) : (
<div className="reader-html" ref={contentRef} />
<div className={markdown ? "reader-markdown" : "reader-html"} ref={contentRef} />
)
) : (
<div className="reader empty">