File tree 1 file changed +3
-2
lines changed
src/resources/filters/quarto-pre
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -236,7 +236,7 @@ function parse_floatreftargets()
236
236
end
237
237
local caption = refCaptionFromDiv (div )
238
238
if caption ~= nil then
239
- div .content :remove (# div . content )
239
+ div .content :remove () -- drop the last element
240
240
elseif div .attributes [caption_attr_key ] ~= nil then
241
241
caption = pandoc .Plain (string_to_quarto_ast_inlines (div .attributes [caption_attr_key ]))
242
242
div .attributes [caption_attr_key ] = nil
@@ -246,7 +246,8 @@ function parse_floatreftargets()
246
246
local found_caption = false
247
247
content = _quarto .ast .walk (content , {
248
248
Table = function (table )
249
- if table .caption .long ~= nil then
249
+ -- check if caption is non-empty
250
+ if next (table .caption .long ) then
250
251
found_caption = true
251
252
caption = table .caption .long [1 ] -- what if there's more than one entry here?
252
253
table .caption .long = nil
You can’t perform that action at this time.
0 commit comments