git.iko.soy/typeable/pandoc
on master help sign in
Allow pipe tables with no body rows.

Previously this raised a runtime error. Closes #2556.

commit33d328f1cf689fc0ceede285617cd027c768e422 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 24 Nov 2015, 20:23 (11 years ago) parentc73ae81
1 file changed+3−2
src/Text/Pandoc/Readers/Markdown.hs+3−2
src/Text/Pandoc/Readers/Markdown.hs+3−2
@@ -1341,9 +1341,10 @@ pipeTable :: MarkdownParser ([Alignment], [Double], F [Blocks], F [[Blocks]])
13411341pipeTable = try $ do
13421342 nonindentSpaces
13431343 lookAhead nonspaceChar
1344− (heads,(aligns, seplengths)) <- (,) <$> pipeTableRow <*> pipeBreak
1344+ ((heads, rawHead),(aligns, seplengths)) <- (,) <$>
1345+ withRaw pipeTableRow <*> pipeBreak
13451346 (lines', rawRows) <- unzip <$> many (withRaw pipeTableRow)
1346− let maxlength = maximum $ map length rawRows
1347+ let maxlength = maximum $ map length (rawHead : rawRows)
13471348 numColumns <- getOption readerColumns
13481349 let widths = if maxlength > numColumns
13491350 then map (\len ->