gearheads
/
mastodon
Archived
2
0
Fork 0

Fix cutting off first letter of hashtag links sometimes in web UI (#24623)

gh/dev
Eugen Rochko 2023-04-24 09:53:54 +02:00 committed by GitHub
parent 2daa5a1549
commit 804aa8d501
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -104,7 +104,7 @@ class StatusContent extends React.PureComponent {
link.setAttribute('href', `/@${mention.get('acct')}`); link.setAttribute('href', `/@${mention.get('acct')}`);
} else if (link.textContent[0] === '#' || (link.previousSibling && link.previousSibling.textContent && link.previousSibling.textContent[link.previousSibling.textContent.length - 1] === '#')) { } else if (link.textContent[0] === '#' || (link.previousSibling && link.previousSibling.textContent && link.previousSibling.textContent[link.previousSibling.textContent.length - 1] === '#')) {
link.addEventListener('click', this.onHashtagClick.bind(this, link.text), false); link.addEventListener('click', this.onHashtagClick.bind(this, link.text), false);
link.setAttribute('href', `/tags/${link.text.slice(1)}`); link.setAttribute('href', `/tags/${link.text.replace(/^#/, '')}`);
} else { } else {
link.setAttribute('title', link.href); link.setAttribute('title', link.href);
link.classList.add('unhandled-link'); link.classList.add('unhandled-link');