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
Allow disabling linkClass #144
Comments
Features * Added ability to override default options via linkify.options.defaults * Options that take functions with value and type arguments can now be specified as objects, where each key is the target type. For example: ``` 'github.com is #rad, please email nick@example.com'.linkify({ formatHref: { email: (mailto) => `${mailto}?subject=Hello`, hashtag: (hashtag) => `https://twitter.com/hashtag/${hashtag.substr(1)}` } }); ``` Bug fixes * Allow disabling linkClass (by using default options) - Fixes #144 Deprecations * Deprecated `linkClass` option. Use `className` instead * Deprecated `linkAttributes` option. Use `attributes` instead. * The `linkified` default class name for links will no longer be provided in a future release Breaking Changes * Fully removed deprecated `newLine` option
* Enhancements and deprecations for options hash Features * Added ability to override default options via linkify.options.defaults * Options that take functions with value and type arguments can now be specified as objects, where each key is the target type. For example: ``` 'github.com is #rad, please email nick@example.com'.linkify({ formatHref: { email: (mailto) => `${mailto}?subject=Hello`, hashtag: (hashtag) => `https://twitter.com/hashtag/${hashtag.substr(1)}` } }); ``` Bug fixes * Allow disabling linkClass (by using default options) - Fixes #144 Deprecations * Deprecated `linkClass` option. Use `className` instead * Deprecated `linkAttributes` option. Use `attributes` instead. * The `linkified` default class name for links will no longer be provided in a future release Breaking Changes * Fully removed deprecated `newLine` option * Unit tests for linkify options utilities Including improvements and fixes for QUnit tests * Additional refactorings and updates to get IE to work Note to self: IE8 is the devil
Please provide a way to disable it without modifying the defaults. Global variables like these are an awful solution, especially because they change behavior for other users of |
The goal of the |
Also FYI: The default |
Thanks. As with globals, I'd disallow modifying defaults in any sane code base as that breaks second or third party code that happens to also depend on |
+1 Have no need to add a class. Switching from angular's linkyFilter to this broke our unit tests with the addition of the linkified class. I guess I'll just expect it to be there for now and remove later. Great looking product, though. Thanks :) |
Fixed in v2.1.6. Specify |
Hey,
Given the falsy, as opposed to an
undefined
, check oflinkClass: opts.linkClass || 'linkified'
(https://github.com/SoapBox/linkifyjs/blob/master/src/linkify/utils/options.js#L25) it's not possible to disable the class entirely. One would have to resort to using" "
to trick the coercive||
. Please consider using=== undefined
to allow removing the class without unintuitive hacks.Thanks!
The text was updated successfully, but these errors were encountered: