-
Notifications
You must be signed in to change notification settings - Fork 331
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
Lua filter error with gfm for a crossref figure #10358
Comments
@cscheid I think this is a required follow up on quarto-cli/src/resources/filters/customnodes/floatreftarget.lua Lines 1041 to 1057 in 0d87b08
We probably need to deal with I see addition local to lightbox - should have a new helper to use everywhere ? quarto-cli/src/resources/filters/layout/lightbox.lua Lines 142 to 148 in 0d87b08
Also sometimes, it seems with use
And other time quarto-cli/src/resources/filters/quarto-post/latex.lua Lines 322 to 324 in 0d87b08
and other place using already a helper
Anyhow, handling a default works, diff --git a/src/resources/filters/customnodes/floatreftarget.lua b/src/resources/filters/customnodes/floatreftarget.lua
index 913e7e5fc..6eb085535 100644
--- a/src/resources/filters/customnodes/floatreftarget.lua
+++ b/src/resources/filters/customnodes/floatreftarget.lua
@@ -1037,11 +1037,11 @@ end, function(float)
local open_block = pandoc.RawBlock("markdown", "<div id=\"" .. float.identifier .. "\">\n")
local close_block = pandoc.RawBlock("markdown", "\n</div>")
if caption_location == "top" then
return pandoc.Blocks({
open_block,
- float.caption_long,
+ float.caption_long or pandoc.Div({}),
float.content,
close_block
})
@@ -1050,7 +1050,7 @@ end, function(float)
open_block,
float.content,
pandoc.RawBlock("markdown", "\n"),
- float.caption_long,
+ float.caption_long or pandoc.Div({}),
close_block
})
end but I am thinking maybe we should be sure to handle this everywhere needed. So assigning to you as you know better each part of FloatRefTarget |
The root cause of this is the upgrade to Pandoc where accessing the nodes no longer creates empty content. The fix is easy and I'll backport. |
The following example throws an error on quarto 1.5.54
The error is the following:
It sounds like it has something to do with the
gfm
output format, it works correctly if I render to html. The first time I encountered this bug I was rendering my project to both gfm and html, and changing that to just render html works as expected. I was using gfm because it gives a nice preview on GitHub.Originally posted by @mbellitti in #9334 (comment)
The text was updated successfully, but these errors were encountered: