Skip to content

Commit 3c5abec

Browse files
extract and link hashtags without punctuation
1 parent c0add7d commit 3c5abec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

front-end/components/bloom.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ const createBloom = (template, bloom) => {
3737
function _formatHashtags(text) {
3838
if (!text) return text;
3939
return text.replace(
40-
/\B#[^#]+/g,
41-
(match) => `<a href="/hashtag/${match.slice(1)}">${match}</a>`
40+
/#([\p{L}0-9_]+)/gu,
41+
(_, tag) => `<a href="/hashtag/${encodeURIComponent(tag)}">#${tag}</a>`
4242
);
4343
}
4444

0 commit comments

Comments
 (0)