From 21d2d918ac8bec6e239fd362b19445da9550a536 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 22 Dec 2010 00:28:20 -0800 Subject: Shared: Removed BlockWrapper, wrappedBlocksToDoc. These are no longer needed with the new Pretty module. --- src/Text/Pandoc/Shared.hs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index e5b000efe..302648a45 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -51,8 +51,6 @@ module Text.Pandoc.Shared ( wrapIfNeeded, wrappedTeX, wrapTeXIfNeeded, - BlockWrapper (..), - wrappedBlocksToDoc, hang', -- * Pandoc block and inline list processing orderedListMarkers, @@ -80,7 +78,7 @@ module Text.Pandoc.Shared ( import Text.Pandoc.Definition import qualified Text.Pandoc.UTF8 as UTF8 (readFile) -import Text.PrettyPrint.HughesPJ ( Doc, fsep, ($$), (<>), empty, isEmpty, text, nest ) +import Text.PrettyPrint.HughesPJ ( Doc, fsep, ($$), (<>), empty, nest ) import qualified Text.PrettyPrint.HughesPJ as PP import Data.Char ( toLower, isLower, isUpper, isAlpha, isAscii, isLetter, isDigit ) @@ -284,16 +282,6 @@ wrapTeXIfNeeded opts includePercent = if writerWrapText opts then wrappedTeX includePercent else ($) --- | Indicates whether block should be surrounded by blank lines (@Pad@) or not (@Reg@). -data BlockWrapper = Pad Doc | Reg Doc - --- | Converts a list of wrapped blocks to a Doc, with appropriate spaces around blocks. -wrappedBlocksToDoc :: [BlockWrapper] -> Doc -wrappedBlocksToDoc = foldr addBlock empty - where addBlock (Pad d) accum | isEmpty accum = d - addBlock (Pad d) accum = d $$ text "" $$ accum - addBlock (Reg d) accum = d $$ accum - -- | A version of hang that works like the version in pretty-1.0.0.0 hang' :: Doc -> Int -> Doc -> Doc hang' d1 n d2 = d1 $$ (nest n d2) -- cgit v1.2.3