Skip to content

Commit ee3f232

Browse files
committed
pandoc, format extensions - Check extension support before disabling
The unconditional disabling of table_attributes in 72452ee caused errors for formats like commonmark_x that don't support this extension. Pandoc 3.8.3+ validates all extension keys (both enabled and disabled) and rejects unsupported extensions. Use pandoc.format.all_extensions() to check if table_attributes is supported by the format before attempting to disable it.
1 parent 5fcbb59 commit ee3f232

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/resources/pandoc/datadir/readqmd.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ local function readqmd(txt, opts)
141141
-- ### Opt-out some extensions that we know we won't support for now ###
142142
-- https://pandoc.org/MANUAL.html#extension-table_attributes
143143
-- https://github.com/quarto-dev/quarto-cli/pull/13249#issuecomment-3715267414
144-
flavor.extensions["table_attributes"] = false
144+
-- Only disable if the extension is actually supported by the format
145+
local all_exts = pandoc.format.all_extensions(flavor.format)
146+
if all_exts:includes('table_attributes') then
147+
flavor.extensions["table_attributes"] = false
148+
end
145149

146150
-- Format flavor, i.e., which extensions should be enabled/disabled.
147151
local function restore_invalid_tags(tag)

0 commit comments

Comments
 (0)