From 494ab2f57b277ab6843db12a4ee8a3681b65546f Mon Sep 17 00:00:00 2001 From: Omikhleia Date: Tue, 21 Jan 2025 00:14:50 +0100 Subject: [PATCH] fix: Djot user-defined pseudo-symbols nesting issue --- packages/markdown/commands.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/markdown/commands.lua b/packages/markdown/commands.lua index 22f4b79..9954cce 100644 --- a/packages/markdown/commands.lua +++ b/packages/markdown/commands.lua @@ -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 @@ -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, @@ -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 @@ -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