Error due to change in pandoc AST
The error:
Fatal error: Cannot use object of type stdClass as array in pandocfilters-php/pandocfilters.php on line 90
At some point pandoc changed the meta part of the AST. Here's how pandocfilters (python) fixed it, but I don't know how to achieve the same result in php: https://github.com/jgm/pandocfilters/commit/039dcc65bc10a14f9038a3671c795198bd50c15a
I changed the call to walk to the following:
$altered = self::walk(
$doc,
$action,
$format,
isset($doc->meta) ? $doc->meta : (isset($doc[0]) && isset($doc[0]->unMeta) ? $doc[0]->unMeta : null)
);
It works for me now (pandoc version is 1.19.2.1).
I fixed this issue and another issue in my fork: https://github.com/glassdimly/pandocfilters-php
Here's the branch if the repo admin wants to merge my commits in: https://github.com/glassdimly/pandocfilters-php/tree/cannot_use_object_as_array
Hi, that's great - can you open a pull request? I'd be happy to accept it!