From 429e25864b86b7b5976348860a302c2843687ef4 Mon Sep 17 00:00:00 2001 From: hmhealey Date: Thu, 8 Oct 2015 18:18:51 -0400 Subject: Modified markdown lexer to not break up words written in snake_case --- web/react/utils/markdown.jsx | 38 ++++++++++++++++++++++++++++++++++++- web/react/utils/text_formatting.jsx | 9 ++------- 2 files changed, 39 insertions(+), 8 deletions(-) (limited to 'web') diff --git a/web/react/utils/markdown.jsx b/web/react/utils/markdown.jsx index 26587dd6e..4fb4c6089 100644 --- a/web/react/utils/markdown.jsx +++ b/web/react/utils/markdown.jsx @@ -6,7 +6,31 @@ const Utils = require('./utils.jsx'); const marked = require('marked'); -export class MattermostMarkdownRenderer extends marked.Renderer { +class MattermostInlineLexer extends marked.InlineLexer { + constructor(links, options) { + super(links, options); + + // modified version of the regex that doesn't break up words in snake_case + // the original is /^[\s\S]+?(?=[\\