From 378242cdde4e417c3bd0d3a936c79fc2a347cf2a Mon Sep 17 00:00:00 2001 From: plebeius Date: Thu, 12 Feb 2026 16:17:44 +0800 Subject: [PATCH] fix(replies): prevent inline quote links from forcing line breaks --- src/components/markdown/markdown.tsx | 2 +- .../reply-quote-preview/reply-quote-preview.tsx | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/components/markdown/markdown.tsx b/src/components/markdown/markdown.tsx index 1280a65a..03383d58 100644 --- a/src/components/markdown/markdown.tsx +++ b/src/components/markdown/markdown.tsx @@ -179,7 +179,7 @@ const NumberQuoteLink = ({ number, threadPostCid }: { number: number; threadPost return {`>>${number}`}; } - return ; + return ; }; const renderAnchorLink = (children: React.ReactNode, href: string, threadPostCid?: string) => { diff --git a/src/components/reply-quote-preview/reply-quote-preview.tsx b/src/components/reply-quote-preview/reply-quote-preview.tsx index 6432e844..6bea6ac0 100644 --- a/src/components/reply-quote-preview/reply-quote-preview.tsx +++ b/src/components/reply-quote-preview/reply-quote-preview.tsx @@ -15,6 +15,7 @@ interface ReplyQuotePreviewProps { isQuotelinkReply?: boolean; quotelinkReply?: Comment; isOP?: boolean; + showTrailingBreak?: boolean; } const handleQuoteHover = (cid: string, onElementOutOfView: () => void) => { @@ -70,7 +71,7 @@ const scrollToThreadCardTop = (threadCid: string) => { return true; }; -const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, isQuotelinkReply, isOP }: ReplyQuotePreviewProps) => { +const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, isQuotelinkReply, isOP, showTrailingBreak = true }: ReplyQuotePreviewProps) => { const [hoveredCid, setHoveredCid] = useState(null); const [outOfViewCid, setOutOfViewCid] = useState(null); const placementRef = useRef('right'); @@ -194,7 +195,7 @@ const DesktopQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, i {isOP && ' (OP)'} {quotelinkReply?.author?.address === account?.author?.address && ' (You)'} -
+ {showTrailingBreak &&
} {hoveredCid === quotelinkReply?.cid && outOfViewCid === quotelinkReply?.cid && createPortal( @@ -339,7 +340,7 @@ const MobileQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, is return isBacklinkReply ? replyBacklink : isQuotelinkReply && replyQuotelink; }; -const ReplyQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, isQuotelinkReply, isOP }: ReplyQuotePreviewProps) => { +const ReplyQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, isQuotelinkReply, isOP, showTrailingBreak }: ReplyQuotePreviewProps) => { const isMobile = useIsMobile(); return isMobile ? ( @@ -351,6 +352,7 @@ const ReplyQuotePreview = ({ backlinkReply, quotelinkReply, isBacklinkReply, isQ isBacklinkReply={isBacklinkReply} isQuotelinkReply={isQuotelinkReply} isOP={isOP} + showTrailingBreak={showTrailingBreak} /> ); };