From 3fd72055aff782c08e919c67c70b9e237595d035 Mon Sep 17 00:00:00 2001 From: Luke Manyamazi Date: Tue, 11 Nov 2025 07:46:29 +0200 Subject: [PATCH 1/2] improved hashtag regex to correctly link all hashtags --- .gitignore | 2 ++ front-end/components/bloom.mjs | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e43b0f9..e8d5699 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ .DS_Store +.venv +node_modules diff --git a/front-end/components/bloom.mjs b/front-end/components/bloom.mjs index 0b4166c..3d88fe9 100644 --- a/front-end/components/bloom.mjs +++ b/front-end/components/bloom.mjs @@ -37,8 +37,12 @@ const createBloom = (template, bloom) => { function _formatHashtags(text) { if (!text) return text; return text.replace( - /\B#[^#]+/g, - (match) => `${match}` + /(^|\s)#[^#\s]+/g, + (match) => { + const space = match.startsWith(' ') ? ' ' : ''; + const tag = match.trim().slice(1); + return `${space}#${tag}`; + } ); } From 25228d8e6f092e6a3b3936d334566adc53db770f Mon Sep 17 00:00:00 2001 From: Luke Manyamazi Date: Tue, 11 Nov 2025 09:18:07 +0200 Subject: [PATCH 2/2] . --- .gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/.gitignore b/.gitignore index e8d5699..e43b0f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ .DS_Store -.venv -node_modules