git.iko.soy/typeable/pandoc
on master help sign in
+ Added some needed "try"s before multicharacter parsers,
f3437ddfiddlosopher
src/Text/Pandoc/Readers/LaTeX.hs+2−2
@@ -131,7 +131,7 @@ parseLaTeX = do
131 option () processLaTeXPreamble -- preamble might not be present (fragment)
131 option () processLaTeXPreamble -- preamble might not be present (fragment)
132 blocks <- parseBlocks
132 blocks <- parseBlocks
133 spaces
133 spaces
134− option "" (string "\\end{document}") -- might not be present (in fragment)
134+ option "" (try (string "\\end{document}")) -- might not be present (in fragment)
135 spaces
135 spaces
136 eof
136 eof
137 state <- getState
137 state <- getState
@@ -540,7 +540,7 @@ doubleQuoteEnd = try (string "''")
540
540
541ellipses = try (do
541ellipses = try (do
542 string "\\ldots"
542 string "\\ldots"
543− option "" (string "{}")
543+ option "" (try (string "{}"))
544 return Ellipses)
544 return Ellipses)
545
545
546enDash = try (do
546enDash = try (do
src/Text/Pandoc/Readers/Markdown.hs+4−4
@@ -729,10 +729,10 @@ emph = do
729 return (Emph (normalizeSpaces result))
729 return (Emph (normalizeSpaces result))
730
730
731strong = do
731strong = do
732− result <- choice [ (enclosed (count 2 (char emphStart))
732+ result <- choice [ (enclosed (try (count 2 (char emphStart)))
733− (count 2 (char emphEnd)) inline),
733+ (try (count 2 (char emphEnd))) inline),
734− (enclosed (count 2 (char emphStartAlt))
734+ (enclosed (try (count 2 (char emphStartAlt)))
735− (count 2 (char emphEndAlt)) inline) ]
735+ (try (count 2 (char emphEndAlt))) inline) ]
736 return (Strong (normalizeSpaces result))
736 return (Strong (normalizeSpaces result))
737
737
738smartPunctuation = do
738smartPunctuation = do
src/Text/Pandoc/Readers/RST.hs+1−1
@@ -567,7 +567,7 @@ emph = do
567 return (Emph (normalizeSpaces result))
567 return (Emph (normalizeSpaces result))
568
568
569strong = do
569strong = do
570− result <- enclosed (string "**") (string "**") inline
570+ result <- enclosed (try (string "**")) (try (string "**")) inline
571 return (Strong (normalizeSpaces result))
571 return (Strong (normalizeSpaces result))
572
572
573whitespace = do
573whitespace = do
src/Text/ParserCombinators/Pandoc.hs+2−2
@@ -93,14 +93,14 @@ escaped parser = try (do
93 return (Str [result]))
93 return (Str [result]))
94
94
95-- | Parses material enclosed between start and end parsers.
95-- | Parses material enclosed between start and end parsers.
96−enclosed :: GenParser Char st t -- ^ start parser
96+enclosed :: GenParser Char st t -- ^ start parser
97 -> GenParser Char st end -- ^ end parser
97 -> GenParser Char st end -- ^ end parser
98 -> GenParser Char st a -- ^ content parser (to be used repeatedly)
98 -> GenParser Char st a -- ^ content parser (to be used repeatedly)
99 -> GenParser Char st [a]
99 -> GenParser Char st [a]
100enclosed start end parser = try (do
100enclosed start end parser = try (do
101 start
101 start
102 notFollowedBy space
102 notFollowedBy space
103− result <- many1Till parser (try end)
103+ result <- many1Till parser end
104 return result)
104 return result)
105
105
106-- | Like @manyTill@, but reads at least one item.
106-- | Like @manyTill@, but reads at least one item.