Autolinker.js
Autolinker.js copied to clipboard
Wrong result when parsing CJK(中文/日文/韩文) char followed by colon
const Autolinker = require("autolinker")
const autolinker = new Autolinker({
urls: {
schemeMatches: true,
tldMatches: false,
ipV4Matches: false
},
newWindow: false,
stripPrefix: false,
email: false,
phone: false,
stripTrailingSlash: false
});
console.log(autolinker.link("链接:https://www.google.com"));
console.log(autolinker.link("link:https://www.google.com"));
console.log(autolinker.link("链接: https://www.google.com"));
console.log(autolinker.link("链接:https://www.google.com"));
https://runkit.com/embed/xpmv085le79y
The 4th result is wrong
Similar example here.
console.log(Autolinker.link("こちら→https://google.com"))
// result: こちら→https://g<a href="http://oogle.com" target="_blank" rel="noopener noreferrer">oogle.com</a>