Render escaped HTML in FormattedMarkdownText; no throw error. (#1911)
This commit is contained in:
parent
6c2307a769
commit
7675dd1af2
1 changed files with 7 additions and 0 deletions
|
|
@ -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};
|
||||
|
|
|
|||
Loading…
Reference in a new issue