Allow haddock-library 1.2, by calling the Documentation.Haddock.Types.MetaDoc record accessor function _doc :: MetaDoc mod id -> DocH mod id
This commit is contained in:
parent
4c9ebf3c2b
commit
693f9abb18
1 changed files with 7 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue