aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-12-03 19:02:35 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-01-25 17:07:40 +0100
commit1ed925ac20a5e6f9fae9848e80c29c7bec791ca8 (patch)
tree7c39e421ffcec601f697ee71926dbd341e5eb924
parenta4bd650277ac8fd2c952f2330e4d23a200d691a5 (diff)
downloadpandoc-1ed925ac20a5e6f9fae9848e80c29c7bec791ca8.tar.gz
TWiki reader: Remove old readTWikiWithWarnings'.
We get warnings for free now from PandocM. (And anyway, this reader doesn't generate any!)
-rw-r--r--src/Text/Pandoc/Readers/TWiki.hs23
1 files 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