From 7675dd1af207ff0a36f5e0523966c9a3c827fee6 Mon Sep 17 00:00:00 2001 From: Martin Kraft Date: Thu, 12 Jul 2018 04:46:05 -0400 Subject: [PATCH] Render escaped HTML in FormattedMarkdownText; no throw error. (#1911) --- app/components/formatted_markdown_text.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/components/formatted_markdown_text.js b/app/components/formatted_markdown_text.js index a87ebdad0..1e41b4899 100644 --- a/app/components/formatted_markdown_text.js +++ b/app/components/formatted_markdown_text.js @@ -61,6 +61,8 @@ class FormattedMarkdownText extends React.PureComponent { softBreak: this.renderBreak, paragraph: this.renderParagraph, del: Renderer.forwardChildren, + html_inline: this.renderHTML, + html_block: this.renderHTML, }, }); } @@ -92,6 +94,11 @@ class FormattedMarkdownText extends React.PureComponent { return {children}; } + renderHTML = (props) => { + console.warn(`HTML used in FormattedMarkdownText component with id ${this.props.id}`); // eslint-disable-line no-console + return this.renderText(props); + } + render() { const {id, defaultMessage, values, theme} = this.props; const messageDescriptor = {id, defaultMessage};