diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-03-28 12:12:48 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-03-28 12:12:48 -0700 |
commit | 6a3a04c4280817df39519bf1d73eee3b9e0b3841 (patch) | |
tree | 304a696d66d3d8cfb6f1441086947c12f2cb1cb8 /src/Text/Pandoc/Readers/MediaWiki.hs | |
parent | d744b83b61bc635419339b73b687b9280ee757fc (diff) | |
parent | ad39bc7009e320b3afb91a5683521eb1eccf0ef7 (diff) | |
download | pandoc-6a3a04c4280817df39519bf1d73eee3b9e0b3841.tar.gz |
Merge branch 'errortype' of https://github.com/mpickering/pandoc into mpickering-errortype
Conflicts:
benchmark/benchmark-pandoc.hs
src/Text/Pandoc/Readers/Markdown.hs
src/Text/Pandoc/Readers/Org.hs
src/Text/Pandoc/Readers/RST.hs
tests/Tests/Readers/LaTeX.hs
Diffstat (limited to 'src/Text/Pandoc/Readers/MediaWiki.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/MediaWiki.hs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs index d1ba35ba0..939d10fb2 100644 --- a/src/Text/Pandoc/Readers/MediaWiki.hs +++ b/src/Text/Pandoc/Readers/MediaWiki.hs @@ -58,21 +58,21 @@ import Data.Maybe (fromMaybe) import Text.Printf (printf) import Debug.Trace (trace) +import Text.Pandoc.Error + -- | Read mediawiki from an input string and return a Pandoc document. readMediaWiki :: ReaderOptions -- ^ Reader options -> String -- ^ String to parse (assuming @'\n'@ line endings) - -> Pandoc + -> Either PandocError Pandoc readMediaWiki opts s = - case runParser parseMediaWiki MWState{ mwOptions = opts + readWith parseMediaWiki MWState{ mwOptions = opts , mwMaxNestingLevel = 4 , mwNextLinkNumber = 1 , mwCategoryLinks = [] , mwHeaderMap = M.empty , mwIdentifierList = [] } - "source" (s ++ "\n") of - Left err' -> error $ "\nError:\n" ++ show err' - Right result -> result + (s ++ "\n") data MWState = MWState { mwOptions :: ReaderOptions , mwMaxNestingLevel :: Int |