To override the link
Kirbytag, I wrote the following code to test the general setup:
$originalTag = Kirby\Text\KirbyTag::$types['link'];
Kirby::plugin('sanofan/link-kirbytag', [
'tags' => [
'link' => [
'html' => function($tag) use ($originalTag) {
$result = $originalTag['html']($tag);
return $result;
}
],
],
]);
But now, with a link such as (link: contact/ text: contact us)
the returned HTML is NOT
<a href="http://localhost/.../contact/">contact us</a>
But instead
<a href="http://localhost/.../contact/ text: contact us"></a><a href="http://localhost/.../contact/">http://localhost/zoom-petro/contact/</a> text: contact us
That is, the output was duplicated, and the HTML of the second link is messed up.
Iβm using Kirby version 3.6.1.1 with PHP version 8.0.13 on localhost.
Do you have any idea what went wrong here?
Cheers,
Stefan