Skip to content

[BUG] unclosed dd/dt tags corrupt the output #315

Description

@fuchsia

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..)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions