From afec6ed792c7c7657f85a98738330604e953ccac Mon Sep 17 00:00:00 2001 From: sheida-shab Date: Wed, 4 Feb 2026 13:00:59 +0000 Subject: [PATCH] update _formatHashtags to correctly link multiple hashtags and handle edge cases --- front-end/components/bloom.mjs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/front-end/components/bloom.mjs b/front-end/components/bloom.mjs index 0b4166c..166ab84 100644 --- a/front-end/components/bloom.mjs +++ b/front-end/components/bloom.mjs @@ -36,9 +36,14 @@ const createBloom = (template, bloom) => { function _formatHashtags(text) { if (!text) return text; - return text.replace( - /\B#[^#]+/g, - (match) => `${match}` + + // Normalize newlines and tabs to spaces + const normalizedText = text.replace(/[\r\n\t]+/g, " "); + + return normalizedText.replace( + // Updated regex to correctly handle multiple hashtags with letters, numbers, and underscores + /#([a-zA-Z0-9_]+)/g, + (match) => `${match}`, ); }