From dc9788b6dc00b96be7f67c6d072b23420dc05dec Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 3 Mar 2017 15:01:23 +0100 Subject: [PATCH] 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. --- src/Text/Pandoc/Pretty.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Pretty.hs b/src/Text/Pandoc/Pretty.hs index f0eb88007..2cf728b9c 100644 --- a/src/Text/Pandoc/Pretty.hs +++ b/src/Text/Pandoc/Pretty.hs @@ -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