diff --git a/src/utils/enhance-content.js b/src/utils/enhance-content.js index acd08a19..6012f377 100644 --- a/src/utils/enhance-content.js +++ b/src/utils/enhance-content.js @@ -18,9 +18,7 @@ function enhanceContent(content, opts = {}) { }); // Spanify un-spanned mentions - const notMentionLinks = Array.from( - dom.querySelectorAll('a[href]:not(.mention)'), - ); + const notMentionLinks = Array.from(dom.querySelectorAll('a[href]')); notMentionLinks.forEach((link) => { const text = link.innerText.trim(); const hasChildren = link.querySelector('*'); @@ -33,7 +31,7 @@ function enhanceContent(content, opts = {}) { } // If text looks like #hashtag, then it's a hashtag if (/^#[^#]+$/g.test(text)) { - if (!hasChildren) link.innerHTML = `#${text}`; + if (!hasChildren) link.innerHTML = `#${text.slice(1)}`; link.classList.add('mention', 'hashtag'); } });