Skip to content

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

@tarleb

Description

@tarleb

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>

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions