prosegrinder/pandoc-templates

Filters not working under pandoc 2.13

calliecameron opened this issue · 2 comments

Looks like the fix for #12 broke the filters on pandoc 2.13:

$ cd test
$ bash run.sh

        ================== Bash Tests ==================

        1. [Short] Single input
        ----------------------------------------
Creating temporary directory.
Directory created: /tmp/tmp.sPGFL1y3uF
Extracting /home/callie/pandoc-templates/shunn/short/template.docx to temporary directory.
Files extracted.
Running Pandoc.
Error running filter /home/callie/pandoc-templates/shunn/short/shunnshort.lua:
/home/callie/pandoc-templates/filters/meta.lua:5: attempt to call a nil value (field 'type')
stack traceback:
        /home/callie/pandoc-templates/filters/meta.lua:5: in function 'Meta'
Pandoc completed successfully.
Removing /tmp/tmp.sPGFL1y3uF
Done.
        2. [Long] Wildcard
        ----------------------------------------
Creating temporary directory.
Directory created: /tmp/tmp.06CaCk20OO
Extracting /home/callie/pandoc-templates/shunn/long/template.docx to temporary directory.
Files extracted.
Running Pandoc.
Error running filter /home/callie/pandoc-templates/shunn/long/shunnlong.lua:
/home/callie/pandoc-templates/filters/meta.lua:5: attempt to call a nil value (field 'type')
stack traceback:
        /home/callie/pandoc-templates/filters/meta.lua:5: in function 'Meta'
Pandoc completed successfully.
Removing /tmp/tmp.06CaCk20OO
Done.

        =============== Powershell Tests ===============

        1. [Short] Single input
        ----------------------------------------
run.sh: line 24: pwsh: command not found
        2. [Short] Various line break conventions
        ----------------------------------------
run.sh: line 27: pwsh: command not found
        3. [Long] Multiple wildcard inputs
        ----------------------------------------
run.sh: line 31: pwsh: command not found

Expected behavior

As seen on the previous commit:

$ cd test
$ bash run.sh


        ================== Bash Tests ==================

        1. [Short] Single input
        ----------------------------------------
Creating temporary directory.
Directory created: /tmp/tmp.GkNGDAdrsT
Extracting /home/callie/pandoc-templates/shunn/short/template.docx to temporary directory.
Files extracted.
Running Pandoc.
Zipping reference.docx using UNIX zip.
Pandoc completed successfully.
Removing /tmp/tmp.GkNGDAdrsT
Done.
        2. [Long] Wildcard
        ----------------------------------------
Creating temporary directory.
Directory created: /tmp/tmp.7YK7sU6O0a
Extracting /home/callie/pandoc-templates/shunn/long/template.docx to temporary directory.
Files extracted.
Running Pandoc.
Zipping reference.docx using UNIX zip.
Pandoc completed successfully.
Removing /tmp/tmp.7YK7sU6O0a
Done.

        =============== Powershell Tests ===============

        1. [Short] Single input
        ----------------------------------------
run.sh: line 24: pwsh: command not found
        2. [Short] Various line break conventions
        ----------------------------------------
run.sh: line 27: pwsh: command not found
        3. [Long] Multiple wildcard inputs
        ----------------------------------------
run.sh: line 31: pwsh: command not found

Environment (please complete the following information):

  • OS: Linux Mint 20.1 Cinnamon
  • Pandoc Version: 2.13
  • Version: commit e28b04f

True. There were breaking changes in release 2.17 of Pandoc that caused the need for this change. I'm not sure at this point there would be a way to support both versions. Any chance of upgrading to Pandoc 2.17 or greater?

Noted. I can't currently upgrade pandoc because of a bug in pandoc, so I'll keep using the commit that works with old versions for now.