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

pandoc.utils.stringify() behaviour change in pandoc 3.6 #10450

Closed
tarleb opened this issue Dec 10, 2024 Discussed in #10447 · 0 comments
Closed

pandoc.utils.stringify() behaviour change in pandoc 3.6 #10450

tarleb opened this issue Dec 10, 2024 Discussed in #10447 · 0 comments
Assignees

Comments

@tarleb
Copy link
Collaborator

tarleb commented Dec 10, 2024

Discussed in #10447

Originally posted by wlupton December 9, 2024
I have noticed that pandoc.utils.stringify() can behave differently in pandoc 3.6. Probably it now behaves as documented, and previously was too lax?

The case that I hit was an attempt to stringify a Caption. Previously this worked but I guess it shouldn't, because you're only supposed to be able to stringify AST elements, and captions are objects with long (Blocks) and short (Inlines) fields.

However, should the behaviour have changed? I'm not sure.


Here are my tests.

% cat figure.md
![Cat](Cat.png)
% cat caption.lua
function Figure(figure)
    local caption = pandoc.utils.stringify(figure.caption)
    io.stderr:write(string.format('#### caption = %s\n', caption))
end
% pandoc-3.5 figure.md -L caption.lua -t html -o /dev/null
#### caption = Cat
% pandoc-3.6 figure.md -L caption.lua -t html -o /dev/null
Error running filter caption.lua:
table expected, got Caption
stack traceback:
	caption.lua:2: in function 'Figure'</div>
@tarleb tarleb self-assigned this Dec 10, 2024
@tarleb tarleb closed this as completed in a084731 Dec 10, 2024
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

1 participant