@@ -32,6 +32,7 @@ module Text.Pandoc.Readers.Markdown (
3232 ) where
3333
3434import Data.List ( findIndex, sortBy )
35+import Data.Char ( isAlphaNum )
3536import Text.ParserCombinators.Pandoc
3637import Text.Pandoc.Definition
3738import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXEnvironment )
@@ -535,7 +536,13 @@ inline = choice [ rawLaTeXInline', escapedChar, special, text ] <?> "inline"
535536special = choice [ noteRef, inlineNote, link, referenceLink, rawHtmlInline',
536537 autoLink, image ] <?> "link, inline html, note, or image"
537538
538−escapedChar = escaped anyChar
539+escapedChar = try $ do
540+ char '\\'
541+ state <- getState
542+ result <- if stateStrict state
543+ then oneOf "\\`*_{}[]()>#+-.!"
544+ else satisfy (not . isAlphaNum)
545+ return (Str [result])
539546
540547ltSign = try (do
541548 notFollowedBy (noneOf "<") -- continue only if it's a <