ProcessHannaCode
ProcessHannaCode copied to clipboard
hanna code code doesn't appear to be re-entrant
I have defined [[blog_list template=blog_stub]] and use it in the body of page X. It uses this PHP:
<?php
foreach(wire('pages')->find("template={$template}") as $p) {
echo <<<END
<div class='entry'>
<h3><a href='{$p->a_url}'>{$p->title}</a></h3>
<div class='excerpt'>{$p->excerpt}</div>
</div>
END;
}
The excerpt field also uses the Hanna code textformatter. The only output is that of the last $p->excerpt, as opposed to the whole list with formatted parts.
IOW, it looks like the last output from $hanna->render() hijacks the one up the stack.
I added a pull request which supports now recursive Hanna Code tags and this should fix the re-entrance issue as well. Maybe you can apply the changes locally and check if it fixes the reported issue.
https://github.com/ryancramerdesign/ProcessHannaCode/pull/10