aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorMark Wright <gienah@gentoo.org>2015-01-05 14:35:31 +1100
committerMark Wright <gienah@gentoo.org>2015-01-05 14:35:31 +1100
commit693f9abb184c3d37864114f93d90a82c60f9ad0b (patch)
tree5dcd42441cae7a2d7bb834221a7a31088288f3cf /src/Text/Pandoc
parent4c9ebf3c2bd0e401a0fd61c31796940763331cef (diff)
downloadpandoc-693f9abb184c3d37864114f93d90a82c60f9ad0b.tar.gz
Allow haddock-library 1.2, by calling the Documentation.Haddock.Types.MetaDoc record accessor function _doc :: MetaDoc mod id -> DocH mod id
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Haddock.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Haddock.hs b/src/Text/Pandoc/Readers/Haddock.hs
index 4b46c869d..c03382c17 100644
--- a/src/Text/Pandoc/Readers/Haddock.hs
+++ b/src/Text/Pandoc/Readers/Haddock.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP #-}
{- |
Module : Text.Pandoc.Readers.Haddock
Copyright : Copyright (C) 2013 David Lazar
@@ -29,7 +30,12 @@ import Debug.Trace (trace)
readHaddock :: ReaderOptions -- ^ Reader options
-> String -- ^ String to parse
-> Pandoc
-readHaddock opts = B.doc . docHToBlocks . trace' . parseParas
+readHaddock opts =
+#if MIN_VERSION_haddock_library(1,2,0)
+ B.doc . docHToBlocks . trace' . _doc . parseParas
+#else
+ B.doc . docHToBlocks . trace' . parseParas
+#endif
where trace' x = if readerTrace opts
then trace (show x) x
else x