Allow disabling linkClass
Hey,
Given the falsy, as opposed to an undefined, check of linkClass: 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!
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 linkify in the same app.
The goal of the defaults override was to provide a way to keep linkify's behaviour consistent between multiple calls to the plugin. e.g., not having to specify the same formatting functions every time you call linkify in your app code. It just happened to solve your problem, and admittedly not in the best way. I'll do a proper job of it in the next fix 😛
Also FYI: The default .linkified class was a carryover from a previous version of this library and is marked as deprecated in the upcoming 2.1 release. We're getting rid of it completely in a future 2.x or 3.x release.
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 linkify. Most package managers, like NPM, share instances of compatible dependencies and changing defaults under other code is a recipe for disaster. ;)
+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 className: null in the options. 3.0 will remove the default linkified class.