diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index d0b859f8..59776255 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -134,6 +134,11 @@ const ContentPanel: React.FC = ({ currentUserPubkey, followedPubkeys }) + // Key used to force re-mount of markdown preview/render when content changes + const contentKey = useMemo(() => { + // Prefer selectedUrl as a stable per-article key; fallback to title+length + return selectedUrl || `${title || ''}:${(markdown || html || '').length}` + }, [selectedUrl, title, markdown, html]) const { contentRef, handleSelectionEnd } = useHighlightInteractions({ onHighlightClick, @@ -751,7 +756,7 @@ const ContentPanel: React.FC = ({
{/* Hidden markdown preview to convert markdown to HTML */} {markdown && ( -
+
= ({ {markdown ? ( renderedMarkdownHtml && finalHtml ? ( = ({ ) ) : (