From af849537819885694cc4487056721480ab21067d Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 21 Jan 2013 09:50:39 -0800 Subject: Markdown reader: Fixed bug with headerless grid tables. The 1.10 code assumed that each table header cell contains exactly one block. That failed for headerless tables (0) and also for tables with multiple blocks in a header cell. The code is fixed and tests provided. Thanks to Andrew Lee for pointing out the bug. --- src/Text/Pandoc/Readers/Markdown.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 1f57d1918..2c6c47307 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1110,7 +1110,7 @@ gridTableHeader headless = try $ do then replicate (length dashes) "" else map (intercalate " ") $ transpose $ map (gridTableSplitLine indices) rawContent - heads <- fmap sequence $ mapM (parseFromString block) $ + heads <- fmap sequence $ mapM (parseFromString parseBlocks) $ map trim rawHeads return (heads, aligns, indices) @@ -1127,7 +1127,7 @@ gridTableRow indices = do colLines <- many1 (gridTableRawLine indices) let cols = map ((++ "\n") . unlines . removeOneLeadingSpace) $ transpose colLines - fmap compactify' <$> fmap sequence (mapM (parseFromString block) cols) + fmap compactify' <$> fmap sequence (mapM (parseFromString parseBlocks) cols) removeOneLeadingSpace :: [String] -> [String] removeOneLeadingSpace xs = -- cgit v1.2.3