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

Custom void tags are not working #248

Closed
zuozuomuxi opened this issue Aug 28, 2023 · 0 comments
Closed

Custom void tags are not working #248

zuozuomuxi opened this issue Aug 28, 2023 · 0 comments

Comments

@zuozuomuxi
Copy link

zuozuomuxi commented Aug 28, 2023

Custom void tags must be written in a self-closing form to be parsed.

var { valid, parse }  = require("node-html-parser")

const voidTags = ['x-tag'];
const html1 = `<div><x-tag></div>`;
const html2 = `<div><x-tag /></div>`;

// => false. Expected to be true
console.log(valid(html1, {
  voidTag: {
    tags: voidTags,
  }
}));

// => true
console.log(valid(html2, {
  voidTag: {
    tags: voidTags,
  }
}));
@taoqf taoqf closed this as completed in 01ff9f4 Sep 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant