This program:
import {parse} from 'node-html-parser';
const text = `<!DOCTYPE html>
<html>
<body>
<dl>
<dt>
<dd>
</dl>
</body>
</html>
`;
console.log( parse( text ).toString( ) );
generates the output:
<!DOCTYPE html>
<html>
</html>
In fact a single, unterminated <dd> or <dt> is enough to trigger the bug; e.g. '<!DOCTYPE html><html><body><dt></body></html>' outputs '<!DOCTYPE html><html></html>' (And note the loss of the container, in all cases..)
This program:
generates the output:
In fact a single, unterminated
<dd>or<dt>is enough to trigger the bug; e.g.'<!DOCTYPE html><html><body><dt></body></html>'outputs'<!DOCTYPE html><html></html>'(And note the loss of the container, in all cases..)