git.iko.soy/typeable/pandoc
on master help sign in
Fixed double-rendering of footnotes in RST tables.
159c711John MacFarlane
src/Text/Pandoc/Writers/RST.hs+2−3
@@ -239,8 +239,7 @@ blockToRST (Table caption _ widths headers rows) = do
239 middle = hcat $ intersperse sep' blocks
239 middle = hcat $ intersperse sep' blocks
240 let makeRow = hpipeBlocks . zipWith lblock widthsInChars
240 let makeRow = hpipeBlocks . zipWith lblock widthsInChars
241 let head' = makeRow headers'
241 let head' = makeRow headers'
242− rows' <- mapM (\row -> do cols <- mapM blockListToRST row
242+ let rows' = map makeRow rawRows
243− return $ makeRow cols) rows
244 let border ch = char '+' <> char ch <>
243 let border ch = char '+' <> char ch <>
245 (hcat $ intersperse (char ch <> char '+' <> char ch) $
244 (hcat $ intersperse (char ch <> char '+' <> char ch) $
246 map (\l -> text $ replicate l ch) widthsInChars) <>
245 map (\l -> text $ replicate l ch) widthsInChars) <>
@@ -427,7 +426,7 @@ inlineToRST (Image alternate (source, tit)) = do
427 return $ "|" <> label <> "|"
426 return $ "|" <> label <> "|"
428inlineToRST (Note contents) = do
427inlineToRST (Note contents) = do
429 -- add to notes in state
428 -- add to notes in state
430− notes <- get >>= return . stNotes
429+ notes <- gets stNotes
431 modify $ \st -> st { stNotes = contents:notes }
430 modify $ \st -> st { stNotes = contents:notes }
432 let ref = show $ (length notes) + 1
431 let ref = show $ (length notes) + 1
433 return $ " [" <> text ref <> "]_"
432 return $ " [" <> text ref <> "]_"