From cf9052d284fc6d57c5bf0afce474b72b34a0ecde Mon Sep 17 00:00:00 2001
From: Reed Garmsen <rgarmsen2295@gmail.com>
Date: Fri, 5 Feb 2016 14:08:05 -0800
Subject: Limits hashtag linking to a minimum of three characters

---
 web/react/utils/text_formatting.jsx | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

(limited to 'web/react/utils/text_formatting.jsx')

diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx
index e837ded53..dae2252a6 100644
--- a/web/react/utils/text_formatting.jsx
+++ b/web/react/utils/text_formatting.jsx
@@ -248,8 +248,14 @@ function autolinkHashtags(text, tokens) {
         const index = tokens.size;
         const alias = `MM_HASHTAG${index}`;
 
+        let value = hashtag;
+
+        if (hashtag.length > Constants.MIN_HASHTAG_LINK_LENGTH) {
+            value = `<a class='mention-link' href='#' data-hashtag='${hashtag}'>${hashtag}</a>`;
+        }
+
         tokens.set(alias, {
-            value: `<a class='mention-link' href='#' data-hashtag='${hashtag}'>${hashtag}</a>`,
+            value,
             originalText: hashtag
         });
 
-- 
cgit v1.2.3-1-g7c22

