git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: internal changes.
c39cdc1John MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+9−5
@@ -939,13 +939,17 @@ failIfLink :: Inline -> GenParser tok st Inline
939failIfLink (Link _ _) = pzero
939failIfLink (Link _ _) = pzero
940failIfLink elt = return elt
940failIfLink elt = return elt
941
941
942−escapedChar :: GenParser Char ParserState Inline
942+escapedChar' :: GenParser Char ParserState Char
943−escapedChar = try $ do
943+escapedChar' = try $ do
944 char '\\'
944 char '\\'
945 state <- getState
945 state <- getState
946− result <- if stateStrict state
946+ if stateStrict state
947− then oneOf "\\`*_{}[]()>#+-.!~"
947+ then oneOf "\\`*_{}[]()>#+-.!~"
948− else satisfy (not . isAlphaNum)
948+ else satisfy (not . isAlphaNum)
949+
950+escapedChar :: GenParser Char ParserState Inline
951+escapedChar = do
952+ result <- escapedChar'
949 return $ case result of
953 return $ case result of
950 ' ' -> Str "\160" -- "\ " is a nonbreaking space
954 ' ' -> Str "\160" -- "\ " is a nonbreaking space
951 '\n' -> LineBreak -- "\[newline]" is a linebreak
955 '\n' -> LineBreak -- "\[newline]" is a linebreak