@@ -51,8 +51,6 @@ module Text.Pandoc.Shared (
51 wrapIfNeeded,
51 wrapIfNeeded,
52 wrappedTeX,
52 wrappedTeX,
53 wrapTeXIfNeeded,
53 wrapTeXIfNeeded,
57 -- * Pandoc block and inline list processing
55 -- * Pandoc block and inline list processing
58 orderedListMarkers,
56 orderedListMarkers,
@@ -80,7 +78,7 @@ module Text.Pandoc.Shared (
81import Text.Pandoc.Definition
79import Text.Pandoc.Definition
82import qualified Text.Pandoc.UTF8 as UTF8 (readFile)
80import qualified Text.Pandoc.UTF8 as UTF8 (readFile)
83−import Text.PrettyPrint.HughesPJ ( Doc, fsep, ($$), (<>), empty, isEmpty, text, nest )
81+import Text.PrettyPrint.HughesPJ ( Doc, fsep, ($$), (<>), empty, nest )
84import qualified Text.PrettyPrint.HughesPJ as PP
82import qualified Text.PrettyPrint.HughesPJ as PP
85import Data.Char ( toLower, isLower, isUpper, isAlpha, isAscii,
83import Data.Char ( toLower, isLower, isUpper, isAlpha, isAscii,
86 isLetter, isDigit )
84 isLetter, isDigit )
@@ -284,16 +282,6 @@ wrapTeXIfNeeded opts includePercent = if writerWrapText opts
284 then wrappedTeX includePercent
282 then wrappedTeX includePercent
287−-- | Indicates whether block should be surrounded by blank lines (@Pad@) or not (@Reg@).
288−data BlockWrapper = Pad Doc | Reg Doc
290−-- | Converts a list of wrapped blocks to a Doc, with appropriate spaces around blocks.
291−wrappedBlocksToDoc :: [BlockWrapper] -> Doc
292−wrappedBlocksToDoc = foldr addBlock empty
293− where addBlock (Pad d) accum | isEmpty accum = d
294− addBlock (Pad d) accum = d $$ text "" $$ accum
295− addBlock (Reg d) accum = d $$ accum
297-- | A version of hang that works like the version in pretty-1.0.0.0
285-- | A version of hang that works like the version in pretty-1.0.0.0
298hang' :: Doc -> Int -> Doc -> Doc
286hang' :: Doc -> Int -> Doc -> Doc
299hang' d1 n d2 = d1 $$ (nest n d2)
287hang' d1 n d2 = d1 $$ (nest n d2)