aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2015-02-18 13:04:24 +0000
committerMatthew Pickering <matthewtpickering@gmail.com>2015-02-18 21:09:06 +0000
commit41d9527533e21716e1268da3e4e37a0c75b7ff34 (patch)
tree3d2c03d445fbaa1f893669578d15d2f414c58aa6 /src/Text
parentacefbe99a95cd5bd8434237fdb0a81c1b63ed06d (diff)
downloadpandoc-41d9527533e21716e1268da3e4e37a0c75b7ff34.tar.gz
Change return type of Mediawiki reader
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/MediaWiki.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/MediaWiki.hs b/src/Text/Pandoc/Readers/MediaWiki.hs
index e43b8a86c..0bb6dd436 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