aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Haddock.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-03-28 12:15:09 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-03-28 12:15:09 -0700
commitb74af6762d4a3c98be741af50fd3f3ac4344bef0 (patch)
treef7d27a6338824283957213438099b6a1269e4667 /src/Text/Pandoc/Readers/Haddock.hs
parent6f4018f8d36ce641a5a67a6dff14de99e662a08f (diff)
parent6a3a04c4280817df39519bf1d73eee3b9e0b3841 (diff)
downloadpandoc-b74af6762d4a3c98be741af50fd3f3ac4344bef0.tar.gz
Merge branch 'mpickering-errortype'
Diffstat (limited to 'src/Text/Pandoc/Readers/Haddock.hs')
-rw-r--r--src/Text/Pandoc/Readers/Haddock.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/Haddock.hs b/src/Text/Pandoc/Readers/Haddock.hs
index c03382c17..aa2534afc 100644
--- a/src/Text/Pandoc/Readers/Haddock.hs
+++ b/src/Text/Pandoc/Readers/Haddock.hs
@@ -26,15 +26,17 @@ import Documentation.Haddock.Parser
import Documentation.Haddock.Types
import Debug.Trace (trace)
+import Text.Pandoc.Error
+
-- | Parse Haddock markup and return a 'Pandoc' document.
readHaddock :: ReaderOptions -- ^ Reader options
-> String -- ^ String to parse
- -> Pandoc
+ -> Either PandocError Pandoc
readHaddock opts =
#if MIN_VERSION_haddock_library(1,2,0)
- B.doc . docHToBlocks . trace' . _doc . parseParas
+ Right . B.doc . docHToBlocks . trace' . _doc . parseParas
#else
- B.doc . docHToBlocks . trace' . parseParas
+ Right . B.doc . docHToBlocks . trace' . parseParas
#endif
where trace' x = if readerTrace opts
then trace (show x) x