Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Workaround bug with dropWhileR in containers < 0.4.

  • Loading branch information...
commit e7eeadc0336f7ad5c3d4daf2f8a9cd9cc5ff5a56 1 parent 0ec53ce
@jgm authored
Showing with 8 additions and 0 deletions.
  1. +8 −0 Text/Pandoc/Builder.hs
View
8 Text/Pandoc/Builder.hs
@@ -226,8 +226,16 @@ instance Listable Blocks Block where
-- | Trim leading and trailing Sp (spaces) from an Inlines.
trimInlines :: Inlines -> Inlines
+#if MIN_VERSION_containers(0,4,0)
trimInlines (Inlines ils) = Inlines $ Seq.dropWhileL (== Space) $
Seq.dropWhileR (== Space) $ ils
+#else
+-- for GHC 6.12, we need to workaround a bug in dropWhileR
+-- see http://hackage.haskell.org/trac/ghc/ticket/4157
+trimInlines (Inlines ils) = Inlines $ Seq.dropWhileL (== Space) $
+ Seq.reverse $ Seq.dropWhileL (== Space) $
+ Seq.reverse ils
+#endif
-- Document builders
Please sign in to comment.
Something went wrong with that request. Please try again.