git.iko.soy/typeable/pandoc
on master help sign in
Parsing: Changed type of escaped to return Char
commit7b971517b031e2df2edee0a39d7dc6737bcf9a38 authorJohn MacFarlane <fiddlosopher@gmail.com> dateMon 5 Dec 2011, 20:22 (15 years ago) parentb2c58c1
3 files changed+5−7
src/Text/Pandoc/Parsing.hs+2−5 src/Text/Pandoc/Readers/LaTeX.hs+1−1 src/Text/Pandoc/Readers/RST.hs+2−1
src/Text/Pandoc/Parsing.hs+2−5
@@ -325,11 +325,8 @@ failUnlessLHS = do
325325
326326-- | Parses backslash, then applies character parser.
327327escaped :: GenParser Char st Char -- ^ Parser for character to escape
328− -> GenParser Char st Inline
329−escaped parser = try $ do
330− char '\\'
331− result <- parser
332− return (Str [result])
328+ -> GenParser Char st Char
329+escaped parser = try $ char '\\' >> parser
333330
334331-- | Parses an uppercase roman numeral and returns (UpperRoman, number).
335332upperRoman :: GenParser Char st (ListNumberStyle, Int)
src/Text/Pandoc/Readers/LaTeX.hs+1−1
@@ -677,7 +677,7 @@ sect = try (string "\\S") >> return (Str [chr 167])
677677escapedChar :: GenParser Char st Inline
678678escapedChar = do
679679 result <- escaped (oneOf specialChars)
680− return $ if result == Str "\n" then Str " " else result
680+ return $ if result == '\n' then Str " " else Str [result]
681681
682682emptyGroup :: GenParser Char st Inline
683683emptyGroup = try $ do
src/Text/Pandoc/Readers/RST.hs+2−1
@@ -750,7 +750,8 @@ hyphens = do
750750 return $ Str result
751751
752752escapedChar :: GenParser Char st Inline
753−escapedChar = escaped anyChar
753+escapedChar = do c <- escaped anyChar
754+ return $ Str [c]
754755
755756symbol :: GenParser Char ParserState Inline
756757symbol = do