aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2014-04-01 10:10:46 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2014-04-01 10:10:46 -0700
commit1cadba16eb91a1f9dae03d87201fe1e8a7e0d1b6 (patch)
treea4d69c697e36680712fd28abc2e5178771bac9c4 /src/Text
parentced8be1d080019f56033c8200974598910985dc4 (diff)
downloadpandoc-1cadba16eb91a1f9dae03d87201fe1e8a7e0d1b6.tar.gz
HTML reader: idiomatic rewriting for clarity.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/HTML.hs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/HTML.hs b/src/Text/Pandoc/Readers/HTML.hs
index 4fab251bb..38619d040 100644
--- a/src/Text/Pandoc/Readers/HTML.hs
+++ b/src/Text/Pandoc/Readers/HTML.hs
@@ -442,13 +442,12 @@ pInlinesInTags :: String -> (Inlines -> Inlines)
pInlinesInTags tagtype f = do
contents <- B.unMany <$> pInTags tagtype inline
let left = case viewl contents of
- EmptyL -> mempty
- (a :< _) -> padSpace a
+ (Space :< _) -> B.space
+ _ -> mempty
let right = case viewr contents of
- EmptyR -> mempty
- (_ :> a) -> padSpace a
+ (_ :> Space) -> B.space
+ _ -> mempty
return (left <> f (trimInlines . B.Many $ contents) <> right)
- where padSpace a = if a == Space then B.space else mempty
pInTags :: (Monoid a) => String -> TagParser a
-> TagParser a