Closed serialbandicoot closed 6 years ago
https://github.com/markdown-it/linkify-it#addkey-value you should extend existing schemas with new ones.
Many thanks @puzrin
@serialbandicoot Can you write an example of how you ended up using this capability?
@serialbandicoot Can you write an example of how you ended up using this capability?
const linkify = require('linkify-it')()
linkify.add('appname://', {
validate: function (text, pos, self) {
var tail = text.slice(pos);
if (!self.re.appname) {
self.re.appname = new RegExp(
'^([a-zA-Z0-9_/]){1,15}(?!_)(?=$|' + self.re.src_ZPCc + ')'
);
}
if (self.re.appname.test(tail)) {
return tail.match(self.re.appname)[0].length;
}
return 0;
},
});
Hey @tegozen, I don’t have access the code anymore. However the issue I had was due to an inter library dependency. I think, from memory in the end I used patch-package to add in the linkify.add(‘app name:’, true) which allowed the schema. So my code worked. Good luck.
I'm using an app, which in turn is using your library and unfortunately :( your library rejects urls, which are used for deep-linking (universal link) in an iOS app.
So my internal linking mechanism is using myapp://xyz/1 - this enables me to deep link into the app.
However this is rejected as being a non-standard url by your library. Would you have a way of passing into the library an option, which validates it as a deep link.