Might it work to call which through a pipe, either pandoc's or lua's io.popen() if the latter isn't disabled? That means two pipings rather than one, but you will know if the program you want to run exists.


Den tors 19 aug. 2021 12:39William Lupton <wlupton@broadband-forum.org> skrev:
All,

I've been using pandoc.pipe() in a lua filter, protected by pcall(). Something like this:

    local succeeded, result = pcall(pandoc.pipe, prog, args, text)

It seems that if 'prog' doesn't exist then pandoc will exit, and pcall() doesn't catch the error. Is that correct and, if so, is there a reason for it? (I'd prefer to be able to catch this case, because it will probably indicate an error on the part of the markdown author.)

Thanks,
William

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CAEe_xxhWuGPjZ0Gaw2PBp%3DVnCjFwOVeMsYr2kN4gxqrSynAP-Q%40mail.gmail.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/CADAJKhBJJoqjhp%3D2D5Hze7EFQ-6WLpiEpHa22vbrV3-czD6-FA%40mail.gmail.com.