diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-21 09:50:39 -0800 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2013-01-21 09:52:24 -0800 |
commit | af849537819885694cc4487056721480ab21067d (patch) | |
tree | 0a1ed38c3413ed71c9218759e4bb89c2969acf22 /src/Text | |
parent | c4b93bc3e7ea2006dbe3273ed06b66129775982e (diff) | |
download | pandoc-af849537819885694cc4487056721480ab21067d.tar.gz |
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.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 4 |
1 files changed, 2 insertions, 2 deletions
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 = |