From e455bee39f2480782d350f156043141fb6bdab26 Mon Sep 17 00:00:00 2001
From: Harrison Healey <harrisonmhealey@gmail.com>
Date: Tue, 20 Sep 2016 11:59:42 -0400
Subject: PLT-4096 Fixed highlighting of hashtags in search (#4043)

* PLT-4096 Fixed highlighting of hashtags in search

* Added unit tests for hashtag rendering on the client
---
 webapp/utils/text_formatting.jsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'webapp/utils/text_formatting.jsx')

diff --git a/webapp/utils/text_formatting.jsx b/webapp/utils/text_formatting.jsx
index 174620d47..23e286b45 100644
--- a/webapp/utils/text_formatting.jsx
+++ b/webapp/utils/text_formatting.jsx
@@ -415,8 +415,8 @@ function convertSearchTermToRegex(term) {
         pattern = '()(' + escapeRegex(term.replace(/\*/g, '')) + ')';
     } else if (term.endsWith('*')) {
         pattern = '\\b()(' + escapeRegex(term.substring(0, term.length - 1)) + ')';
-    } else if (term.startsWith('@')) {
-        // needs special handling of the first boundary because a word boundary doesn't work before an @ sign
+    } else if (term.startsWith('@') || term.startsWith('#')) {
+        // needs special handling of the first boundary because a word boundary doesn't work before a symbol
         pattern = '(\\W|^)(' + escapeRegex(term) + ')\\b';
     } else {
         pattern = '\\b()(' + escapeRegex(term) + ')\\b';
-- 
cgit v1.2.3-1-g7c22

