From cf9052d284fc6d57c5bf0afce474b72b34a0ecde Mon Sep 17 00:00:00 2001 From: Reed Garmsen 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 = `${hashtag}`; + } + tokens.set(alias, { - value: `${hashtag}`, + value, originalText: hashtag }); -- cgit v1.2.3-1-g7c22