diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index be7ee6cd..5e3b507f 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -74,6 +74,10 @@ const ContentPanel: React.FC = ({ return sourceHtml }, [html, renderedHtml, markdown, relevantHighlights, showUnderlines, highlightStyle]) + // Check if we need to wait for HTML conversion + const needsHtmlConversion = markdown && !renderedHtml + const shouldShowContent = !needsHtmlConversion || relevantHighlights.length === 0 + // Attach click handlers to highlight marks useEffect(() => { if (!onHighlightClick || !contentRef.current) return @@ -184,24 +188,24 @@ const ContentPanel: React.FC = ({ )} {markdown || html ? ( - finalHtml ? ( -
- ) : markdown ? ( -
- - {markdown} - -
- ) : ( -
- ) + finalHtml || (markdown && shouldShowContent) ? ( + finalHtml ? ( +
+ ) : ( +
+ + {markdown} + +
+ ) + ) : null ) : (

No readable content found for this URL.