links encoded with /
In many JS texts treatments, links html are encoded like :
https://html5-chat.com/
Any idea on how handle these cases ?
Linkify's HTML interface http://soapbox.github.io/linkifyjs/docs/linkify-html.html should theoretically handle this, but HTML character encoding support is temporarily disabled in the built-in HTML parser. This may be fixed in a future release.
I stepped over this issue, but I think in my case I would expect a different result, because my URL is followed by a HTML character reference, that is not part of the URL and gets broken:
const linkifyHtml = require('linkifyjs/html'); // v2.1.6
const html = ""http://xml.example.com/pub/example.dtd"";
const out = linkifyHtml(html, {nl2br: true, className: "", target: ""})
console.info(out);
// Generates:
// "<a href="http://xml.example.com/pub/example.dtd"">http://xml.example.com/pub/example.dtd"</a>;
// -> the text inside the link contains an invalid character ref """
//
// but in this case I would expect that the following HTML character reference is not destroyed:
// "<a href="http://xml.example.com/pub/example.dtd"">http://xml.example.com/pub/example.dtd</a>"
Actually, I've no idea how these two cases can be automatically distinguished. Maybe add an option?
-> Should I open a new issue for this or would you regard this as related?
Fixed in the latest Linkify v4