Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore elements with specifed class #181

Open
artemijan opened this issue Jan 4, 2017 · 2 comments
Open

Ignore elements with specifed class #181

artemijan opened this issue Jan 4, 2017 · 2 comments

Comments

@artemijan
Copy link

artemijan commented Jan 4, 2017

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>?

@nfrasser
Copy link
Owner

nfrasser commented Jan 5, 2017

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!

@artemijan
Copy link
Author

Thanks for quick reply, you guys do a great job!

@nfrasser nfrasser added this to the 4.1+ milestone Oct 14, 2021
@nfrasser nfrasser removed this from the 4.1+ milestone Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants