html-react-parser #124

https://github.com/remarkablemark/html-react-parser/issues/124

by remarkablemark

HTML

<div id="root"></div>
<script src="https://unpkg.com/html-react-parser@latest/dist/html-react-parser.js"></script>

CSS

/**
 * @see https://github.com/remarkablemark/html-react-parser/issues/124
 */

React

/**
 * Open console to see error:
 *   Uncaught DOMException: Failed to execute 'createElement' on 'Document': The tag name provided ('a@b.c') is not a valid name.
 */

const html = '<a@b.com><p>text</p><foo>bar</foo>';
const elements = HTMLReactParser(html);

ReactDOM.render(elements, document.getElementById('root'));