From 33d328f1cf689fc0ceede285617cd027c768e422 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 24 Nov 2015 20:23:06 -0800 Subject: Allow pipe tables with no body rows. Previously this raised a runtime error. Closes #2556. --- src/Text/Pandoc/Readers/Markdown.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index d0c03062a..64cd817ba 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1341,9 +1341,10 @@ pipeTable :: MarkdownParser ([Alignment], [Double], F [Blocks], F [[Blocks]]) pipeTable = try $ do nonindentSpaces lookAhead nonspaceChar - (heads,(aligns, seplengths)) <- (,) <$> pipeTableRow <*> pipeBreak + ((heads, rawHead),(aligns, seplengths)) <- (,) <$> + withRaw pipeTableRow <*> pipeBreak (lines', rawRows) <- unzip <$> many (withRaw pipeTableRow) - let maxlength = maximum $ map length rawRows + let maxlength = maximum $ map length (rawHead : rawRows) numColumns <- getOption readerColumns let widths = if maxlength > numColumns then map (\len -> -- cgit v1.2.3