Skip to content

Commit 7b844eb

Browse files
committed
Prevent unintended side-effects of filter functions
1 parent c10d8e1 commit 7b844eb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/resources/filters/normalize/flags.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ function compute_flags()
107107
-- FIXME: are we actually triggering this with FloatRefTargets?
108108
-- table captions
109109
local kTblCap = "tbl-cap"
110-
local tblCap = extractTblCapAttrib(node,kTblCap)
111-
if hasTableRef(node) or tblCap then
110+
if hasTableRef(node) or node.attr.attributes[kTblCap] then
112111
flags.has_table_captions = true
113112
end
114113

src/resources/filters/quarto-pre/table-captions.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ function extractTblCapAttrib(el, name, subcap)
231231
else
232232
value = pandoc.List({ value })
233233
end
234-
el.attr.attributes[name] = nil
234+
-- el.attr.attributes[name] = nil
235235
return value
236236
end
237237
return nil

0 commit comments

Comments
 (0)