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 <noreply@anthropic.com>
This commit is contained in:
John MacFarlane
2026-09-20 17:02:00 +00:00
co-authored by Claude
parent 10e95ba298
commit f06f5ad062
+1 -2
View File
@@ -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) <>