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