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

Author's roles being null errors badly in Lua #11057

Open
cderv opened this issue Oct 14, 2024 · 0 comments
Open

Author's roles being null errors badly in Lua #11057

cderv opened this issue Oct 14, 2024 · 0 comments
Assignees
Labels
authors Issues related to author/affiliation normalization bug Something isn't working lua Issues related to the lua codebase, filter chain, etc

Comments

@cderv
Copy link
Collaborator

cderv commented Oct 14, 2024

From @roaldarbol in #11055 (reply in thread)_

---
title: "Untitled"
format: html
author:
  - name: Some name
    roles: ~
---

Content

This will throw uncatch Lua error

Error running filter C:/Users/chris/DOCUME~1/DEV_R/QUARTO~2/src/resources/filters/main.lua:
...sources\pandoc\datadir\..\..\filters\modules/authors.lua:747: bad argument #1 to 'for iterator' (table expected, got string)
stack traceback:
	...sources\pandoc\datadir\..\..\filters\modules/authors.lua:747: in upvalue 'parseRole'
	...sources\pandoc\datadir\..\..\filters\modules/authors.lua:779: in upvalue 'processAuthorRoles'
	...sources\pandoc\datadir\..\..\filters\modules/authors.lua:1001: in upvalue 'processAuthor'
	...sources\pandoc\datadir\..\..\filters\modules/authors.lua:1079: in function 'modules/authors.processAuthorMeta'
	...QUARTO~2/src/resources/filters/./normalize/normalize.lua:36: in function <...QUARTO~2/src/resources/filters/./normalize/normalize.lua:34>
	[C]: in ?
	[C]: in method 'walk'
	...V_R/QUARTO~2/src/resources/filters/./ast/customnodes.lua:76: in function <...V_R/QUARTO~2/src/resources/filters/./ast/customnodes.lua:65>
	(...tail calls...)
	...V_R/QUARTO~2/src/resources/filters/./ast/customnodes.lua:87: in function 'run_emulated_filter'
	..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:82: in local 'callback'
	..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:100: in upvalue 'run_emulated_filter_chain'
	..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:136: in function <..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:133>
stack traceback:
	...V_R/QUARTO~2/src/resources/filters/./ast/customnodes.lua:76: in function <...V_R/QUARTO~2/src/resources/filters/./ast/customnodes.lua:65>
	(...tail calls...)
	...V_R/QUARTO~2/src/resources/filters/./ast/customnodes.lua:87: in function 'run_emulated_filter'
	..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:82: in local 'callback'
	..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:100: in upvalue 'run_emulated_filter_chain'
	..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:136: in function <..._R/QUARTO~2/src/resources/filters/./ast/runemulation.lua:133>

And YAML validation does not help here it seems.

We should probably handle null values for roles correctly, and throw more nicely

@cderv cderv self-assigned this Oct 14, 2024
@cderv cderv added authors Issues related to author/affiliation normalization lua Issues related to the lua codebase, filter chain, etc bug Something isn't working labels Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
authors Issues related to author/affiliation normalization bug Something isn't working lua Issues related to the lua codebase, filter chain, etc
Projects
None yet
Development

No branches or pull requests

1 participant