Closed lukasbestle closed 5 years ago
As I posted on the Forums, I ended up with this on RegExr. RegExr uses Javascript and uses the g
flag. IIRC g
is implicit with preg_replace_callback() in PHP, so no need to add it.
Of course I haven't tested it yet, but I think the results could be promising.
By changing the RegEx slightly, the
widont
helper could be used to be applied to more than one paragraph at once. I don't know if that would break expected behavior (depending on how it is currently used by Kirby users), but it is a nice idea.