aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-28 09:35:43 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-28 09:35:43 -0800
commit5ba5373ec66dfbafc16e28320851d70e1be46f80 (patch)
tree5e944ce317eb7456a5233aafb2a5ad55d785b2e7
parent219573eed213dd40a405f24e3acfddf9a9ffb379 (diff)
downloadpandoc-5ba5373ec66dfbafc16e28320851d70e1be46f80.tar.gz
Shared: Make 'normalize' more generic.
Now it can transform an Inline, [Inline], Block, [Block], or Pandoc.
-rw-r--r--src/Text/Pandoc/Shared.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index 876a2b21b..e40d99207 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -257,7 +257,7 @@ normalizeSpaces = cleanup . dropWhile isSpaceOrEmpty
-- | Normalize @Pandoc@ document, consolidating doubled 'Space's,
-- combining adjacent 'Str's and 'Emph's, remove 'Null's and
-- empty elements, etc.
-normalize :: Pandoc -> Pandoc
+normalize :: Data a => a -> a
normalize = topDown consolidateInlines .
bottomUp removeEmptyInlines .
topDown removeEmptyBlocks