From 0239239d29068c7e7d6df65bfeebbc3b7b232d73 Mon Sep 17 00:00:00 2001
From: hmhealey <harrisonmhealey@gmail.com>
Date: Fri, 6 Nov 2015 12:55:14 -0500
Subject: Changed markdown text regex to not capture the final underscore on a
 word to better match the original behaviour

---
 web/react/utils/markdown.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx
index e293b9c7f..84c63a18b 100644
--- a/web/react/utils/markdown.jsx
+++ b/web/react/utils/markdown.jsx
@@ -24,7 +24,7 @@ class MattermostInlineLexer extends marked.InlineLexer {
         // modified version of the regex that doesn't break up words in snake_case,
         // allows for links starting with www, and allows links succounded by parentheses
         // the original is /^[\s\S]+?(?=[\\<!\[_*`~]|https?:\/\/| {2,}\n|$)/
-        this.rules.text = /^[\s\S]+?(?:[^\w\/](?=_)|(?=[\\<!\[*`~]|https?:\/\/|www\.|\(| {2,}\n|$))/;
+        this.rules.text = /^[\s\S]+?(?:[^\w\/](?=_)|(?=_\W|[\\<!\[*`~]|https?:\/\/|www\.|\(| {2,}\n|$))/;
 
         // modified version of the regex that allows links starting with www and those surrounded
         // by parentheses
-- 
cgit v1.2.3-1-g7c22

