pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
600 stars 165 forks source link

Failing include does not lead to non zero exit code #281

Closed janvlug closed 2 months ago

janvlug commented 2 months ago

When an include fails, pandoc still returns 0 when exiting.

Take for example this file: example.md

and execute this pandoc command:

pandoc --fail-if-warnings --lua-filter=include-files.lua example.md --output jan.html

This results in this messages in the terminal:

Cannot open file file_to_include.html | Skipping includes

However, the exit code is still 0 instead of an error code.

Initially, I incorrectly reported this issue here: https://github.com/jgm/pandoc/issues/9972

The response was:

Please re-raise this issue with the project from where you've gotten the include-files.lua filter. The filter should use the pandoc.log module to raise the warning.

Pandoc version? pandoc 3.1.3 Features: -server +lua Scripting engine: Lua 5.4

tarleb commented 2 months ago

I've pushed a fix, but it requires pandoc 3.1.4.