git.iko.soy/typeable/pandoc
on master help sign in
Simplify Text.Pandoc.Pretty.offset
commit509d2ea525cd30425b4d8c408722a7492b95fde5 authorAlexander Krotov <ilabdsf@gmail.com> dateTue 23 Oct 2018, 13:35 (8 years ago) parentec2d86e
1 file changed+1−3
src/Text/Pandoc/Pretty.hs+1−3
src/Text/Pandoc/Pretty.hs+1−3
@@ -438,9 +438,7 @@ afterBreak s = Doc $ singleton (AfterBreak s)
438438
439439-- | Returns the width of a 'Doc'.
440440offset :: Doc -> Int
441−offset d = case map realLength . lines . render Nothing $ d of
442− [] -> 0
443− os -> maximum os
441+offset d = maximum (0: map realLength (lines $ render Nothing d))
444442
445443-- | Returns the minimal width of a 'Doc' when reflowed at breakable spaces.
446444minOffset :: Doc -> Int