Pretty: don't error for blocks of size < 1.

Instead, resize to 1.

Note, this (together with earlier changes to the Markdown
writer) seems to fix #1785.

The table renders as garbage, but pandoc now completes the conversion
quickly and doesn't get tied up.
This commit is contained in:
John MacFarlane 2017-03-03 15:01:23 +01:00
parent 24f027fe8d
commit dc9788b6dc

View file

@ -466,7 +466,7 @@ height = length . lines . render Nothing
block :: (String -> String) -> Int -> Doc -> Doc
block filler width d
| width < 1 && not (isEmpty d) = error "Text.Pandoc.Pretty.block: width < 1"
| width < 1 && not (isEmpty d) = block filler 1 d
| otherwise = Doc $ singleton $ Block width $ map filler
$ chop width $ render (Just width) d