Hey,
I am pretty sure about this topic was spoken before but I could only find threads about escaping parenthesis inside kirbytags. But I want the whole kirbytag to be escaped inside a <code>
element and I just don’t get it to work…
Just like: (link:http://google.com text:Google)
Dennis
1 Like
Nice, that does the trick
But why doesn’t this work in a kirbytext post-filter? If I use the code below it just removes the kirbytag completely from the DOM.
kirbytext::$post[] = function($kirbytext, $value) {
return str_replace('(\\','(', $value);
};
Good question, I would have expected a filter to work as well. Will get back to this later (after cooking and eating ).
1 Like
Hm, I tested this and the filter works for me as expected (tested with Kirby 2.5.4)
I realized that it just doesn’t work within the columns-plugin by @bastianallgeier (columns.php). But I am definitely not enough of a regex-wizard to figure out why
I assume this is not because of the regex pattern but rather because the kirbytext()
method is called on the field within the pre filter (so that the post filter does not have any effect).
Sounds reasonable. I think I’ll stay with your original answer as it works seamlessly.