From 1af9d25c8aef00e8a4e8890edeea1ec90eb5076d Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Mon, 24 Apr 2023 09:53:54 +0200 Subject: [PATCH] Fix cutting off first letter of hashtag links sometimes in web UI (#24623) --- app/javascript/mastodon/components/status_content.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/mastodon/components/status_content.jsx b/app/javascript/mastodon/components/status_content.jsx index 60f820bc52..dd589dac6d 100644 --- a/app/javascript/mastodon/components/status_content.jsx +++ b/app/javascript/mastodon/components/status_content.jsx @@ -104,7 +104,7 @@ class StatusContent extends React.PureComponent { link.setAttribute('href', `/@${mention.get('acct')}`); } 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.setAttribute('href', `/tags/${link.text.slice(1)}`); + link.setAttribute('href', `/tags/${link.text.replace(/^#/, '')}`); } else { link.setAttribute('title', link.href); link.classList.add('unhandled-link');