I think I’ve found a bug, but wanted to outline the issue before filing on GitHub…
I’m trying to provide a list of related external links on certain pages. To do this, I’ve added a structured list, like so:
related: - [Kirby website](http://getkirby.com) - (twitter: getkirby text: Follow Kirby on Twitter)
I have the following template:
<section> <h1>Related Links</h1> <ul> <? foreach($page->related()->yaml() as $related): ?> <li><?= kirbytext($related) ?></li> <? endforeach ?> </ul> </section>
…which generates the following HTML:
<section> <h1>Related Links</h1> <ul> <li><p><a href="http://getkirby.com">Kirby website</a></p></li> <li><br> <b>Notice</b>: Trying to get property of non-object in <b>/Users/paulrobertlloyd/Sites/bradshawsguide/kirby/core/kirbytext.php</b> on line <b>39</b><br> </li> </ul> </section>
Note that, while standard markdown is parsed correctly, any kirbytext tags throw the following error:
Notice: Trying to get property of non-object in /Users/paulrobertlloyd/Sites/bradshawsguide/kirby/core/kirbytext.php on line 39
It seems kirbytext gets in a tangle when placed inside an array (inspecting the output using
a::show, it looks like kirbytext outputs an array itself, which might be why I’m seeing this issue).
Of course, I could just avoid using kirbytext tags inside this related field… except I’ve created a custom tag which I’d really like to use here.
Should I file a bug?