Skip to content

Commit

Permalink
fix: Djot user-defined pseudo-symbols nesting issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Omikhleia authored and Didier Willis committed Jan 20, 2025
1 parent a204e93 commit 494ab2f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/markdown/commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ local function decimalFilter (input, _)
end

local function wrapLinkContent (options, content)
local passedOptions = pl.tablex.copy(options) -- shallow
local passedOptions = pl.tablex.copy(options) -- shallow before removing internal options
-- We already took care of these.
passedOptions.src = nil
passedOptions.id = nil
Expand Down Expand Up @@ -247,7 +247,7 @@ function package:registerCommands ()
-- We'll want the ID to apply to the captioning environment (to potentially
-- use the caption numbering)
local id = image.options.id
image.options.id = nil
image.options.id = nil -- FIXME should we shallow copy options before changing fields? (Case of re-use via pseudo-symbols)
-- We also propagate image options to the englobing environment
SILE.call("markdown:internal:captioned-figure", image.options, {
image,
Expand Down Expand Up @@ -508,7 +508,7 @@ Please consider using a resilient-compatible class!]])
if not (self.hasPackageSupport.piecharts or self.hasPackageSupport.piechart) then -- HACK Some early versions of piecharts have the wrong internal name
SU.error("No piecharts package available to render CSV data ".. uri)
end
options.src = nil
options.src = nil -- FIXME should we shallow copy options before changing fields? (Case of re-use via pseudo-symbols)
options.csvfile = uri
SILE.call("piechart", options)
else
Expand Down Expand Up @@ -848,6 +848,7 @@ Please consider using a resilient-compatible class!]])
local text = ":" .. symbol .. ":"
content = { text }
end
options = pl.tablex.copy(options) -- shallow before removing internal options
options._symbol_ = nil
options._standalone_ = nil
if next(options) and not standalone then
Expand Down

0 comments on commit 494ab2f

Please sign in to comment.