From b472e496d1815ffed64c756ba06732190dc36481 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Mon, 4 Sep 2023 20:10:08 +0800 Subject: [PATCH] Fix bug: hashtags opening account sheet --- src/utils/handle-content-links.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/handle-content-links.js b/src/utils/handle-content-links.js index af17d618..9f0623fe 100644 --- a/src/utils/handle-content-links.js +++ b/src/utils/handle-content-links.js @@ -8,7 +8,11 @@ function handleContentLinks(opts) { if (!target) return; const prevText = target.previousSibling?.textContent; const textBeforeLinkIsAt = prevText?.endsWith('@'); - if (target.classList.contains('u-url') || textBeforeLinkIsAt) { + const textStartsWithAt = target.innerText.startsWith('@'); + if ( + (target.classList.contains('u-url') && textStartsWithAt) || + (textBeforeLinkIsAt && !textStartsWithAt) + ) { const targetText = ( target.querySelector('span') || target ).innerText.trim();