aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2010-12-25 14:02:38 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2010-12-25 14:03:43 -0800
commit82903cfaf367a68d53f6a6ab2dfad71c5f8a2502 (patch)
treea2deaf0fa9cc91dd610aac0ec20c0aebabec7198 /src/Text
parent10d85f8b0b31f117f79e53d2c50cf20d0fd0fab1 (diff)
downloadpandoc-82903cfaf367a68d53f6a6ab2dfad71c5f8a2502.tar.gz
Improved normalize.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Shared.hs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index ca60a706f..406c1e5c6 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -263,6 +263,10 @@ normalize = topDown normalizeInlines .
normalizeBlocks :: [Block] -> [Block]
normalizeBlocks (Null : xs) = normalizeBlocks xs
+normalizeBlocks (BulletList [] : xs) = normalizeBlocks xs
+normalizeBlocks (OrderedList _ [] : xs) = normalizeBlocks xs
+normalizeBlocks (DefinitionList [] : xs) = normalizeBlocks xs
+normalizeBlocks (RawHtml [] : xs) = normalizeBlocks xs
normalizeBlocks (RawHtml x : RawHtml y : zs) = normalizeBlocks $
RawHtml (x++y) : zs
normalizeBlocks (x:xs) = x : normalizeBlocks xs
@@ -286,6 +290,15 @@ normalizeInlines (Space : ys) =
where isSpace Space = True
isSpace _ = False
rest = normalizeInlines $ dropWhile isSpace ys
+normalizeInlines (Emph [] : zs) = normalizeInlines zs
+normalizeInlines (Strong [] : zs) = normalizeInlines zs
+normalizeInlines (Subscript [] : zs) = normalizeInlines zs
+normalizeInlines (Superscript [] : zs) = normalizeInlines zs
+normalizeInlines (SmallCaps [] : zs) = normalizeInlines zs
+normalizeInlines (Strikeout [] : zs) = normalizeInlines zs
+normalizeInlines (TeX [] : zs) = normalizeInlines zs
+normalizeInlines (HtmlInline [] : zs) = normalizeInlines zs
+normalizeInlines (Code [] : zs) = normalizeInlines zs
normalizeInlines (Emph xs : Emph ys : zs) = normalizeInlines $
Emph (xs ++ ys) : zs
normalizeInlines (Strong xs : Strong ys : zs) = normalizeInlines $
@@ -302,6 +315,8 @@ normalizeInlines (TeX x : TeX y : zs) = normalizeInlines $
TeX (x ++ y) : zs
normalizeInlines (HtmlInline x : HtmlInline y : zs) = normalizeInlines $
HtmlInline (x ++ y) : zs
+normalizeInlines (Code x : Code y : zs) = normalizeInlines $
+ Code (x ++ y) : zs
normalizeInlines (x : xs) = x : normalizeInlines xs
normalizeInlines [] = []