@@ -419,9 +419,6 @@ offset d = case map realLength . lines . render Nothing $ d of
420 os -> maximum os
420 os -> maximum os
422−block :: (String -> String) -> Int -> Doc -> Doc
423−block filler width = Doc . singleton . Block width .
424− map filler . chop width . render (Just width)
426-- | @lblock n d@ is a block of width @n@ characters, with
423-- | @lblock n d@ is a block of width @n@ characters, with
427-- text derived from @d@ and aligned to the left.
424-- 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
440height :: Doc -> Int
437height :: Doc -> Int
441height = length . lines . render Nothing
438height = length . lines . render Nothing
440+block :: (String -> String) -> Int -> Doc -> Doc
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
443chop :: Int -> String -> [String]
446chop :: Int -> String -> [String]
444chop _ [] = []
447chop _ [] = []
445chop n cs = case break (=='\n') cs of
448chop n cs = case break (=='\n') cs of