diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2015-02-18 13:03:28 +0000 |
---|---|---|
committer | Matthew Pickering <matthewtpickering@gmail.com> | 2015-02-18 21:09:06 +0000 |
commit | 9f6a92d664aa89eac4641e80cf2b9b10b6360e7f (patch) | |
tree | 9171c55bb138b61dcb588e229508dcad2148b1b3 /src/Text | |
parent | b9e04825cf993cebc7f48d00a9faf057c3443578 (diff) | |
download | pandoc-9f6a92d664aa89eac4641e80cf2b9b10b6360e7f.tar.gz |
Change return type of Haddock reader
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Readers/Haddock.hs | 8 |
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 |