aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-22 00:28:20 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-22 00:28:20 -0800
commit21d2d918ac8bec6e239fd362b19445da9550a536 (patch)
tree9aa19424caf717857df5ee5e88ce6f5d8530633f /src/Text
parent369502bbb4b15dd8636ecd1af1096c3f802ead0e (diff)
downloadpandoc-21d2d918ac8bec6e239fd362b19445da9550a536.tar.gz
Shared: Removed BlockWrapper, wrappedBlocksToDoc.
These are no longer needed with the new Pretty module.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Shared.hs14
1 files changed, 1 insertions, 13 deletions
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)