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

turn off/on plugin per usage #389

Open
plandem opened this issue Apr 28, 2022 · 1 comment
Open

turn off/on plugin per usage #389

plandem opened this issue Apr 28, 2022 · 1 comment

Comments

@plandem
Copy link

plandem commented Apr 28, 2022

We may have a few different uses on the same page at the same time. And while in one case a plugin can be valid, it can be totally opposite in another case. Is there any way to turn off/on plugins except the validate option? It can be really annoying to use fake validators each time:

<Linkify options={{ validate: { foo: () => false }}>...</Linkify>
<Linkify options={{ validate: { bar: () => false }}>...</Linkify>
<Linkify options={{ validate: { baz: () => false }}>...</Linkify>
@nfrasser
Copy link
Collaborator

Unfortunately this is the only way to do it. Note that you don't have to declare a function for each key, you can just set it to false

e.g.,

<Linkify options={{ validate: { foo: false }}>...</Linkify>

Can you suggest a better API to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants