Autolinker.js
Autolinker.js copied to clipboard
Allowing option to specify target for cordova compatibility
Thanks for this plugin and I've found that to allow it to work in cordova / phonegap, we need to use target="_system" instead of _blank.
This is required in Cordova's InAppBrowser plugin. Perhaps can include an option to specify the target instead of just newWindow?
Thanks.
+1 please!
Hey, interesting. Will see what I can come up with.
Here's a workaround for the meantime:
var html = Autolinker.link( "Test google.com", {
replaceFn : function( autolinker, match ) {
var tag = match.buildTag(); // returns an Autolinker.HtmlTag instance
tag.setAttr( 'target', '_system' );
return tag;
}
} );
+1 thx for the workaround