diff options
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 4 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 8 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 2 | ||||
-rw-r--r-- | src/Text/ParserCombinators/Pandoc.hs | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs index c152cc336..150b7cb6f 100644 --- a/src/Text/Pandoc/Readers/LaTeX.hs +++ b/src/Text/Pandoc/Readers/LaTeX.hs @@ -131,7 +131,7 @@ parseLaTeX = do option () processLaTeXPreamble -- preamble might not be present (fragment) blocks <- parseBlocks spaces - option "" (string "\\end{document}") -- might not be present (in fragment) + option "" (try (string "\\end{document}")) -- might not be present (in fragment) spaces eof state <- getState @@ -540,7 +540,7 @@ doubleQuoteEnd = try (string "''") ellipses = try (do string "\\ldots" - option "" (string "{}") + option "" (try (string "{}")) return Ellipses) enDash = try (do diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index a7456426f..afd0056ab 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -729,10 +729,10 @@ emph = do return (Emph (normalizeSpaces result)) strong = do - result <- choice [ (enclosed (count 2 (char emphStart)) - (count 2 (char emphEnd)) inline), - (enclosed (count 2 (char emphStartAlt)) - (count 2 (char emphEndAlt)) inline) ] + result <- choice [ (enclosed (try (count 2 (char emphStart))) + (try (count 2 (char emphEnd))) inline), + (enclosed (try (count 2 (char emphStartAlt))) + (try (count 2 (char emphEndAlt))) inline) ] return (Strong (normalizeSpaces result)) smartPunctuation = do diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index a0bcc822f..2391fa497 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -567,7 +567,7 @@ emph = do return (Emph (normalizeSpaces result)) strong = do - result <- enclosed (string "**") (string "**") inline + result <- enclosed (try (string "**")) (try (string "**")) inline return (Strong (normalizeSpaces result)) whitespace = do diff --git a/src/Text/ParserCombinators/Pandoc.hs b/src/Text/ParserCombinators/Pandoc.hs index a825ef8ff..93494241a 100644 --- a/src/Text/ParserCombinators/Pandoc.hs +++ b/src/Text/ParserCombinators/Pandoc.hs @@ -93,14 +93,14 @@ escaped parser = try (do return (Str [result])) -- | Parses material enclosed between start and end parsers. -enclosed :: GenParser Char st t -- ^ start parser +enclosed :: GenParser Char st t -- ^ start parser -> GenParser Char st end -- ^ end parser -> GenParser Char st a -- ^ content parser (to be used repeatedly) -> GenParser Char st [a] enclosed start end parser = try (do start notFollowedBy space - result <- many1Till parser (try end) + result <- many1Till parser end return result) -- | Like @manyTill@, but reads at least one item. |