aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 080e2525c..e50180a63 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -760,21 +760,24 @@ failIfInQuoteContext context = do
singleQuoteStart = do
failIfInQuoteContext InSingleQuote
char '\8216' <|>
- do char '\''
- notFollowedBy (oneOf ")!],.;:-? \t\n")
- notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >>
- satisfy (not . isAlphaNum))) -- possess/contraction
- return '\''
-
-singleQuoteEnd = char '\8217' <|>
- (char '\'' >> notFollowedBy alphaNum >> return '\'')
+ (try $ do char '\''
+ notFollowedBy (oneOf ")!],.;:-? \t\n")
+ notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >>
+ satisfy (not . isAlphaNum)))
+ -- possess/contraction
+ return '\'')
+
+singleQuoteEnd = try $ do
+ char '\8217' <|> char '\''
+ notFollowedBy alphaNum
+ return '\''
doubleQuoteStart = do
failIfInQuoteContext InDoubleQuote
char '\8220' <|>
- do char '"'
- notFollowedBy (oneOf " \t\n")
- return '"'
+ (try $ do char '"'
+ notFollowedBy (oneOf " \t\n")
+ return '"')
doubleQuoteEnd = char '\8221' <|> char '"'