@@ -419,9 +419,6 @@ offset d = case map realLength . lines . render Nothing $ d of
419419 [] -> 0
420420 os -> maximum os
421421
422−block :: (String -> String) -> Int -> Doc -> Doc
423−block filler width = Doc . singleton . Block width .
424− map filler . chop width . render (Just width)
425422
426423-- | @lblock n d@ is a block of width @n@ characters, with
427424-- text derived from @d@ and aligned to the left.
@@ -440,6 +437,12 @@ cblock w = block (\s -> replicate ((w - realLength s) `div` 2) ' ' ++ s) w
440437height :: Doc -> Int
441438height = length . lines . render Nothing
442439
440+block :: (String -> String) -> Int -> Doc -> Doc
441+block filler width d
442+ | width < 1 && not (isEmpty d) = error "Text.Pandoc.Pretty.block: width < 1"
443+ | otherwise = Doc $ singleton $ Block width $ map filler
444+ $ chop width $ render (Just width) d
445+
443446chop :: Int -> String -> [String]
444447chop _ [] = []
445448chop n cs = case break (=='\n') cs of