I’ve been wanting to built a plugin to fix the built-in Str::widont() method, since the current method is quite rudimentary (doesn’t work on multiple paragraphs and breaks strings ending with an HTML tag). I’m targeting the Str::widont() method since it is the underlying method used for both the ->widont() field method and the widont() helper function.
I couldn’t find any documentation or examples on how to modify a Kirby helper class using a plugin. Can this be done without replacing the Str class if at all?
If overwriting the method isn’t an option, I’m considering creating a custom field, helper, and Str method. I already know how to create a custom field method and a helper function, but I don’t know what the best approaches to extend a core toolkit class is.
Thank you in advance for your help(^_^)
Noé Gogniat