mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-27 04:40:35 +03:00
Fix bug: hashtags opening account sheet
This commit is contained in:
parent
17a289ac22
commit
b472e496d1
1 changed files with 5 additions and 1 deletions
|
@ -8,7 +8,11 @@ function handleContentLinks(opts) {
|
||||||
if (!target) return;
|
if (!target) return;
|
||||||
const prevText = target.previousSibling?.textContent;
|
const prevText = target.previousSibling?.textContent;
|
||||||
const textBeforeLinkIsAt = prevText?.endsWith('@');
|
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 = (
|
const targetText = (
|
||||||
target.querySelector('span') || target
|
target.querySelector('span') || target
|
||||||
).innerText.trim();
|
).innerText.trim();
|
||||||
|
|
Loading…
Add table
Reference in a new issue