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