git.iko.soy/typeable/pandoc
on master help sign in
TWiki reader: Remove old readTWikiWithWarnings'.

We get warnings for free now from PandocM. (And anyway, this reader doesn't generate any!)

commit1ed925ac20a5e6f9fae9848e80c29c7bec791ca8 authorJohn MacFarlane <jgm@berkeley.edu> dateSat 3 Dec 2016, 19:02 (10 years ago) parenta4bd650
1 file changed+5−18
src/Text/Pandoc/Readers/TWiki.hs+5−18
src/Text/Pandoc/Readers/TWiki.hs+5−18
@@ -45,32 +45,19 @@ import Data.Maybe (fromMaybe)
4545import Text.HTML.TagSoup
4646import Data.Char (isAlphaNum)
4747import qualified Data.Foldable as F
48−import Text.Pandoc.Error
49−
5048import Control.Monad.Except (throwError)
5149import Text.Pandoc.Class (PandocMonad)
52−import qualified Text.Pandoc.Class as P
5350
5451-- | Read twiki from an input string and return a Pandoc document.
5552readTWiki :: PandocMonad m
5653 => ReaderOptions
5754 -> String
5855 -> m Pandoc
59−readTWiki opts s = case readTWikiWithWarnings' opts s of
60− Right (doc, warns) -> do
61− mapM_ P.warning warns
62− return doc
63− Left e -> throwError e
64−
65−readTWikiWithWarnings' :: ReaderOptions -- ^ Reader options
66− -> String -- ^ String to parse (assuming @'\n'@ line endings)
67− -> Either PandocError (Pandoc, [String])
68−readTWikiWithWarnings' opts s =
69− (readWith parseTWikiWithWarnings) def{ stateOptions = opts } (s ++ "\n\n")
70− where parseTWikiWithWarnings = do
71− doc <- parseTWiki
72− warnings <- stateWarnings <$> getState
73− return (doc, warnings)
56+readTWiki opts s =
57+ case (readWith parseTWiki) def{ stateOptions = opts } (s ++ "\n\n") of
58+ Left e -> throwError e
59+ Right d -> return d
60+
7461
7562type TWParser = Parser [Char] ParserState
7663