Closed
Description
Expected Behavior
Tags inside of <title>
should be escaped as text on Node.js:
const parse = require('html-react-parser');
parse('<title><em>text</em></title>');
Output:
{
'$$typeof': Symbol(react.element),
type: 'title',
key: null,
ref: null,
props: { children: '<em>text</em>' },
_owner: null,
_store: {}
}
Actual Behavior
Tags inside of <title>
are parsed as React elements on Node.js:
const parse = require('html-react-parser');
parse('<title><em>text</em></title>');
Output:
{
'$$typeof': Symbol(react.element),
type: 'title',
key: null,
ref: null,
props: {
children: {
'$$typeof': Symbol(react.element),
type: 'em',
key: null,
ref: null,
props: { children: 'text' },
_owner: null,
_store: {}
}
},
_owner: null,
_store: {}
}
Steps to Reproduce
See above.
Reproducible Demo
Repl.it: https://repl.it/@remarkablemark/html-react-parser-202
Environment
- Version: 1.1.0
- Platform: Node.js
- Browser: N/A