Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error due to change in pandoc AST #6

Open
bumper314 opened this issue Jan 31, 2017 · 3 comments
Open

Error due to change in pandoc AST #6

bumper314 opened this issue Jan 31, 2017 · 3 comments

Comments

@bumper314
Copy link

bumper314 commented Jan 31, 2017

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: jgm/pandocfilters@039dcc6

@pestaa
Copy link

pestaa commented Aug 29, 2017

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).

@glassdimly
Copy link

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

@Vinai
Copy link
Owner

Vinai commented Aug 1, 2018

Hi, that's great - can you open a pull request? I'd be happy to accept it!

kalkin pushed a commit to kalkin/pandocfilters-php that referenced this issue Aug 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants