Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser.valid accepts malformed input #227

Open
BadIdeaException opened this issue Nov 8, 2022 · 0 comments
Open

parser.valid accepts malformed input #227

BadIdeaException opened this issue Nov 8, 2022 · 0 comments

Comments

@BadIdeaException
Copy link

It seems that parser.valid accepts even the most ludicrously malformed input strings as valid HTML:

const { valid } = require('node-html-parser');

var valid = require("node-html-parser").valid;

valid('<p abc</p'); // false
valid('<div<p abc</p></span>'); // false
valid('<div><p abc</p></div>'); // true
valid('<div<p abc</a></div>'); // true
valid('@#><p'); // true
valid('<<>'); // true

Also see here on RunKit

As far as I can see, none of the above should be true.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants