mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-15 19:26:31 +02:00
fix(ui): prevent duplicate hero images and fix text overflow in reader view
This commit is contained in:
1 parent
361fe4b407
commit
fe7c603b4e
1 file changed
+9
-2
@@ -8,7 +8,14 @@ interface ReaderViewProps {
|
|||||||
|
|
||||||
export function ReaderView({ article, onClose, onToggleFavorite }: ReaderViewProps) {
|
export function ReaderView({ article, onClose, onToggleFavorite }: ReaderViewProps) {
|
||||||
// Determine content to show: full content > summary > default message
|
// Determine content to show: full content > summary > default message
|
||||||
const displayContent = article.content || article.summary || '<p class="italic text-paper-muted">Aucun contenu disponible pour cet article.</p>';
|
let displayContent = article.content || article.summary || '<p class="italic text-paper-muted">Aucun contenu disponible pour cet article.</p>';
|
||||||
|
|
||||||
|
// If we have a hero image, try to remove the first image from the content to avoid duplicates
|
||||||
|
if (article.image_url) {
|
||||||
|
// Simple regex to remove the first img tag if it exists at the start of the content
|
||||||
|
// This is a heuristic and might need refinement, but handles the "duplicate" complaint common in RSS
|
||||||
|
displayContent = displayContent.replace(/<img[^>]*>/, '');
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@@ -92,7 +99,7 @@ export function ReaderView({ article, onClose, onToggleFavorite }: ReaderViewPro
|
|||||||
</header>
|
</header>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className="magazine-content text-paper-white/90 text-xl font-reading leading-relaxed space-y-8 selection:bg-gold/20"
|
className="magazine-content text-paper-white/90 text-xl font-reading leading-relaxed space-y-8 selection:bg-gold/20 break-words overflow-x-hidden"
|
||||||
dangerouslySetInnerHTML={{ __html: displayContent }}
|
dangerouslySetInnerHTML={{ __html: displayContent }}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user