linkifyjs
linkifyjs copied to clipboard
HTML comment of a single hyphen isn't tokenized correctly
- Comments containing noting but a single
-are not terminated properly, causing actual markup to be commented out. Note that a double hyphen--has the same effect.
To reproduce
import linkifyHtml from 'linkify-html';
function main() {
const html = `<div><!----->Markup</div>`
const result = linkifyHtml(html, {defaultProtocol: "https"})
console.log({html, result})
}
main()
See that the output of linkifyHtml("<div><!----->Markup</div>", {defaultProtocol: "https"}) is "<div><!----->Markup</div>-->"
We will try to find time to contribute a fix for this issue, but if someone gets to it before we do, that's also fine by us :)