Render escaped HTML in FormattedMarkdownText; no throw error. (#1911)

This commit is contained in:
Martin Kraft 2018-07-12 04:46:05 -04:00 committed by Sudheer
parent 6c2307a769
commit 7675dd1af2

View file

@ -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 <Text>{children}</Text>;
}
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};