linkifyjs
linkifyjs copied to clipboard
Ignore elements with specifed class
is there an option to ignore not a tag but some class name for example. i just want not to linkify for example all <span class="link-removed-by-user">google.com</span>
?
Unfortunately ignoring by tag name is currently the only option. If you want to ignore specific domains, you can use the validate
option:
'www.google.com'.linkify({
validate: {
url: function (value) {
// Ignore URLs containing "google.com"
return !(/google\.com/).test(value);
}
}
});
I'm open to adding an "ignore-by-CSS-selector" option. Pull requests welcome!
Thanks for quick reply, you guys do a great job!