summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-03-03 15:01:23 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-03-03 15:01:23 +0100
commitdc9788b6dc00b96be7f67c6d072b23420dc05dec (patch)
tree991a7bad675a2a97c7e15e4bb0e33467a960bdf7 /src/Text/Pandoc
parent24f027fe8d46c56c02b52254c331e220ebdd88b5 (diff)
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.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Pretty.hs2
1 files changed, 1 insertions, 1 deletions
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