From 188147d057719ddf0df3417a06e58eadb2ceaa73 Mon Sep 17 00:00:00 2001 From: Gigi Date: Sun, 5 Oct 2025 03:42:28 +0100 Subject: [PATCH] fix: update originalHtmlRef when content changes - Remove faulty conditional that prevented HTML ref from updating - Now properly stores fresh content when switching articles - Fixes issue where articles weren't switching properly --- src/components/ContentPanel.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/ContentPanel.tsx b/src/components/ContentPanel.tsx index 79567bc8..2aa5fef4 100644 --- a/src/components/ContentPanel.tsx +++ b/src/components/ContentPanel.tsx @@ -84,10 +84,8 @@ const ContentPanel: React.FC = ({ // Store original HTML when content changes useEffect(() => { if (!contentRef.current) return - // Only store if we don't have it yet or content changed - if (!originalHtmlRef.current || html) { - originalHtmlRef.current = contentRef.current.innerHTML - } + // Store the fresh HTML content + originalHtmlRef.current = contentRef.current.innerHTML }, [html, markdown, selectedUrl]) // Apply highlights after DOM is rendered