Change return type of RST reader
This commit is contained in:
parent
4c91049345
commit
2b7073860b
1 changed files with 4 additions and 2 deletions
|
@ -51,13 +51,15 @@ import Data.Monoid (mconcat, mempty)
|
|||
import Data.Sequence (viewr, ViewR(..))
|
||||
import Data.Char (toLower, isHexDigit, isSpace)
|
||||
|
||||
import Text.Pandoc.Error
|
||||
|
||||
-- | Parse reStructuredText string and return Pandoc document.
|
||||
readRST :: ReaderOptions -- ^ Reader options
|
||||
-> String -- ^ String to parse (assuming @'\n'@ line endings)
|
||||
-> Pandoc
|
||||
-> Either PandocError Pandoc
|
||||
readRST opts s = (readWith parseRST) def{ stateOptions = opts } (s ++ "\n\n")
|
||||
|
||||
readRSTWithWarnings :: ReaderOptions -> String -> (Pandoc, [String])
|
||||
readRSTWithWarnings :: ReaderOptions -> String -> Either PandocError (Pandoc, [String])
|
||||
readRSTWithWarnings opts s = (readWith (returnWarnings parseRST)) def{ stateOptions = opts } (s ++ "\n\n")
|
||||
|
||||
type RSTParser = Parser [Char] ParserState
|
||||
|
|
Loading…
Add table
Reference in a new issue