From f06f5ad062008eadae01487bdbc3e488b8f2cae9 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 20 Sep 2026 05:24:19 +0000 Subject: [PATCH] Org writer: don't render table body rows twice. Table rows were converted once to compute column widths and then again to produce the output. Since blockListToOrg is stateful, any footnote in a table cell was registered twice, yielding duplicate footnote definitions and skewed numbering; it also doubled the rendering work. Reuse the first conversion. Co-Authored-By: Claude --- src/Text/Pandoc/Writers/Org.hs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs index f1a516a66..296ee196f 100644 --- a/src/Text/Pandoc/Writers/Org.hs +++ b/src/Text/Pandoc/Writers/Org.hs @@ -246,8 +246,7 @@ blockToOrg (Table _ blkCapt specs thead tbody tfoot) = do middle = hcat $ intersperse sep' blocks let makeRow = hpipeBlocks . zipWith lblock widthsInChars let head' = makeRow headers' - rows' <- mapM (\row -> do cols <- mapM blockListToOrg row - return $ makeRow cols) rows + let rows' = map makeRow rawRows let border ch = char '|' <> char ch <> (hcat . intersperse (char ch <> char '+' <> char ch) $ map (\l -> text $ replicate l ch) widthsInChars) <>