From 6906584f47d382e6a61dbdd0220b395664f81619 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Tue, 28 Aug 2007 07:24:56 +0000 Subject: Refactored escapeChar so it doesn't need 'try'. git-svn-id: https://pandoc.googlecode.com/svn/trunk@939 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Readers/Markdown.hs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Text/Pandoc/Readers') diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 3dda843bc..1af2688f9 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -639,12 +639,12 @@ inline = choice [ str , symbol , ltSign ] "inline" -escapedChar = try $ do +escapedChar = do char '\\' state <- getState - result <- if stateStrict state - then oneOf "\\`*_{}[]()>#+-.!~" - else satisfy (not . isAlphaNum) + result <- option '\\' $ if stateStrict state + then oneOf "\\`*_{}[]()>#+-.!~" + else satisfy (not . isAlphaNum) return $ Str [result] ltSign = do -- cgit v1.2.3