From 1ed925ac20a5e6f9fae9848e80c29c7bec791ca8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 3 Dec 2016 19:02:35 +0100 Subject: TWiki reader: Remove old readTWikiWithWarnings'. We get warnings for free now from PandocM. (And anyway, this reader doesn't generate any!) --- src/Text/Pandoc/Readers/TWiki.hs | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/src/Text/Pandoc/Readers/TWiki.hs b/src/Text/Pandoc/Readers/TWiki.hs index b4546883b..da908a58c 100644 --- a/src/Text/Pandoc/Readers/TWiki.hs +++ b/src/Text/Pandoc/Readers/TWiki.hs @@ -45,32 +45,19 @@ import Data.Maybe (fromMaybe) import Text.HTML.TagSoup import Data.Char (isAlphaNum) import qualified Data.Foldable as F -import Text.Pandoc.Error - import Control.Monad.Except (throwError) import Text.Pandoc.Class (PandocMonad) -import qualified Text.Pandoc.Class as P -- | Read twiki from an input string and return a Pandoc document. readTWiki :: PandocMonad m => ReaderOptions -> String -> m Pandoc -readTWiki opts s = case readTWikiWithWarnings' opts s of - Right (doc, warns) -> do - mapM_ P.warning warns - return doc - Left e -> throwError e - -readTWikiWithWarnings' :: ReaderOptions -- ^ Reader options - -> String -- ^ String to parse (assuming @'\n'@ line endings) - -> Either PandocError (Pandoc, [String]) -readTWikiWithWarnings' opts s = - (readWith parseTWikiWithWarnings) def{ stateOptions = opts } (s ++ "\n\n") - where parseTWikiWithWarnings = do - doc <- parseTWiki - warnings <- stateWarnings <$> getState - return (doc, warnings) +readTWiki opts s = + case (readWith parseTWiki) def{ stateOptions = opts } (s ++ "\n\n") of + Left e -> throwError e + Right d -> return d + type TWParser = Parser [Char] ParserState -- cgit v1.2.3