diff --git a/packages/pl-fe/src/components/parsed-content.tsx b/packages/pl-fe/src/components/parsed-content.tsx index f9cd78863..2d502c541 100644 --- a/packages/pl-fe/src/components/parsed-content.tsx +++ b/packages/pl-fe/src/components/parsed-content.tsx @@ -181,7 +181,7 @@ function parseContent({ // Quote posting if (hasQuote) selectors.push('quote-inline'); - const hashtags: Array = []; + let hashtags: Array = []; let hasSuspiciousUrl = false; @@ -287,15 +287,26 @@ function parseContent({ for (const child of domNode.children) { switch (child.type) { case 'text': - if (child.data.trim().length) return; + if (child.data.trim().length) { + hashtags = []; + return; + } break; case 'tag': - if (child.name !== 'a') return; - if (!child.attribs.class?.split(' ').includes('hashtag')) return; + if (child.name !== 'a') { + hashtags = []; + return; + } + if (!child.attribs.class?.split(' ').includes('hashtag')) { + hashtags = []; + return; + } hashtags.push(normalizeHashtag(nodesToText([child]))); break; default: + hashtags = []; return; + } }