Closed fuhrmanator closed 1 year ago
Thanks for the report. The diagram generator now has a new home at https://github.com/pandoc-ext/diagram. I don't think I want to change the filter's behavior with regard to empty captions, as other users might use them intentionally. Relevant xkcd: https://xkcd.com/1172/
I was working on a big document and didn't see the figure caption (or number) anymore for one of my PlantUML diagrams. I had forgotten to complete the caption:
The figure appears properly, but there are no errors. I wish I had known about this before the PDF went for proofing.
So, I hacked a modification to the filter (I'm not much of a lua programmer), but it looks like this, replacing lines https://github.com/pandoc/lua-filters/blob/master/diagram-generator/diagram-generator.lua#L354-L358
It results in RED console output (I use Pandoc in Quarto):
and I can search in my PDF file for the bad caption (I wasn't sure how to provide more context/location info inside the LUA error).
It's not a huge issue, but would save time if someone else makes this (admittedly stupid) mistake.