git.iko.soy/typeable/pandoc
on master help sign in
Shared: Removed BlockWrapper, wrappedBlocksToDoc.

These are no longer needed with the new Pretty module.

commit21d2d918ac8bec6e239fd362b19445da9550a536 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 22 Dec 2010, 00:28 (16 years ago) parent369502b
1 file changed+1−13
src/Text/Pandoc/Shared.hs+1−13
src/Text/Pandoc/Shared.hs+1−13
@@ -51,8 +51,6 @@ module Text.Pandoc.Shared (
5151 wrapIfNeeded,
5252 wrappedTeX,
5353 wrapTeXIfNeeded,
54− BlockWrapper (..),
55− wrappedBlocksToDoc,
5654 hang',
5755 -- * Pandoc block and inline list processing
5856 orderedListMarkers,
@@ -80,7 +78,7 @@ module Text.Pandoc.Shared (
8078
8179import Text.Pandoc.Definition
8280import 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 )
8482import qualified Text.PrettyPrint.HughesPJ as PP
8583import Data.Char ( toLower, isLower, isUpper, isAlpha, isAscii,
8684 isLetter, isDigit )
@@ -284,16 +282,6 @@ wrapTeXIfNeeded opts includePercent = if writerWrapText opts
284282 then wrappedTeX includePercent
285283 else ($)
286284
287−-- | Indicates whether block should be surrounded by blank lines (@Pad@) or not (@Reg@).
288−data BlockWrapper = Pad Doc | Reg Doc
289−
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
296−
297285-- | A version of hang that works like the version in pretty-1.0.0.0
298286hang' :: Doc -> Int -> Doc -> Doc
299287hang' d1 n d2 = d1 $$ (nest n d2)