diff options
author | hmhealey <harrisonmhealey@gmail.com> | 2015-09-19 11:08:39 -0400 |
---|---|---|
committer | hmhealey <harrisonmhealey@gmail.com> | 2015-09-19 11:18:37 -0400 |
commit | 144a277a44350af14993d439b3bd9999f75e84e7 (patch) | |
tree | 086e02d2aa1200a8804c52efb559a686a27a34e9 /web/react/utils/text_formatting.jsx | |
parent | 5f18c71d07e8ea0ac3f9053ad0a67c5380e613ef (diff) | |
download | chat-144a277a44350af14993d439b3bd9999f75e84e7.tar.gz chat-144a277a44350af14993d439b3bd9999f75e84e7.tar.bz2 chat-144a277a44350af14993d439b3bd9999f75e84e7.zip |
Cleaned up markdown formatting code and removed debug statements
Diffstat (limited to 'web/react/utils/text_formatting.jsx')
-rw-r--r-- | web/react/utils/text_formatting.jsx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/web/react/utils/text_formatting.jsx b/web/react/utils/text_formatting.jsx index 47b56cc3c..4e390f708 100644 --- a/web/react/utils/text_formatting.jsx +++ b/web/react/utils/text_formatting.jsx @@ -17,9 +17,11 @@ const markdownRenderer = new Markdown.MattermostMarkdownRenderer(); // - searchTerm - If specified, this word is highlighted in the resulting html. Defaults to nothing. // - mentionHighlight - Specifies whether or not to highlight mentions of the current user. Defaults to true. // - singleline - Specifies whether or not to remove newlines. Defaults to false. +// - markdown - Enables markdown parsing. Defaults to true. export function formatText(text, options = {}) { - // TODO remove me - options.markdown = true; + if (!('markdown' in options)) { + options.markdown = true; + } // wait until marked can sanitize the html so that we don't break markdown block quotes let output; @@ -46,12 +48,10 @@ export function formatText(text, options = {}) { // perform markdown parsing while we have an html-free input string if (options.markdown) { - console.log('output before marked ' + output); output = marked(output, { renderer: markdownRenderer, sanitize: true }); - console.log('output after marked ' + output); } // reinsert tokens with formatted versions of the important words and phrases |