Fix bug: hashtags opening account sheet

This commit is contained in:
Lim Chee Aun 2023-09-04 20:10:08 +08:00
parent 17a289ac22
commit b472e496d1

View file

@ -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();