From 472a228cd72ce3570a19d87a1b84e3fa2272415f Mon Sep 17 00:00:00 2001 From: Cheng Peng Date: Fri, 6 Nov 2026 01:13:02 -0800 Subject: [PATCH 1/9] fix(mentions): show the mention after a link that ends at CJK punctuation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A person mentioned right after a bare link and fullwidth or CJK punctuation, as in `https://x.com,@Honey`, was notified, but the timeline showed `@Honey` as plain text. The mention display still ended a URL only at whitespace, so the name counted as part of the link, while rendered links end at CJK punctuation since #2404. Bare URLs there now end with the pattern messageLinkParts uses, moved to relay/message-content.ts exactly as #2772 moves it. `` and `](url)` keep CJK punctuation as before. Co-authored-by: Claude Opus 5.5 Signed-off-by: Cheng Peng Co-authored-by: Cursor --- src/features/messages/MessageMarkdown.test.tsx | 9 +++++++++ src/features/messages/message-link-parts.ts | 12 ++++++++---- src/features/messages/profile-mentions.test.ts | 16 ++++++++++++++++ src/features/messages/profile-mentions.ts | 11 ++++++++--- src/features/relay/message-content.ts | 6 ++++++ 5 files changed, 47 insertions(+), 7 deletions(-) diff --git a/src/features/messages/MessageMarkdown.test.tsx b/src/features/messages/MessageMarkdown.test.tsx index 994460bebd..3da6cec985 100644 --- a/src/features/messages/MessageMarkdown.test.tsx +++ b/src/features/messages/MessageMarkdown.test.tsx @@ -707,6 +707,15 @@ describe("Markdown profile mentions", () => { }, ); + it("renders a mention after a bare link that ends at CJK punctuation", () => { + const html = render("看这个 https://example.test,@Mic"); + expect([...html.matchAll(/href="([^"]*)"/g)].map((m) => m[1])).toEqual([ + "https://example.test/", + ]); + expect(html).toContain(',