diff options
author | John MacFarlane <jgm@berkeley.edu> | 2010-04-10 12:05:26 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2010-04-10 12:05:26 -0700 |
commit | 5d9d7f32cacde467a747b7ae8e7d8d85a410e528 (patch) | |
tree | 499a898a7bada2fdd376482fd4b7e1193166767f | |
parent | 54316a0159f776ea3ef843ab94003cc2a593a141 (diff) | |
download | pandoc-5d9d7f32cacde467a747b7ae8e7d8d85a410e528.tar.gz |
In parsing smart quotes, leave unicode curly quotes alone.
Resolves Issue #143.
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 13edd0586..bc8e7cd43 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -67,7 +67,7 @@ setextHChars = "=-" -- treat these as potentially non-text when parsing inline: specialChars :: [Char] -specialChars = "\\[]*_~`<>$!^-.&'\"\8216\8217\8220\8221;" +specialChars = "\\[]*_~`<>$!^-.&'\";" -- -- auxiliary functions @@ -1070,30 +1070,28 @@ failIfInQuoteContext context = do singleQuoteStart :: GenParser Char ParserState Char singleQuoteStart = do failIfInQuoteContext InSingleQuote - char '\8216' <|> - (try $ do char '\'' - notFollowedBy (oneOf ")!],.;:-? \t\n") - notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >> - satisfy (not . isAlphaNum))) - -- possess/contraction - return '\'') + try $ do char '\'' + notFollowedBy (oneOf ")!],.;:-? \t\n") + notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >> + satisfy (not . isAlphaNum))) + -- possess/contraction + return '\'' singleQuoteEnd :: GenParser Char st Char singleQuoteEnd = try $ do - char '\8217' <|> char '\'' + char '\'' notFollowedBy alphaNum return '\'' doubleQuoteStart :: GenParser Char ParserState Char doubleQuoteStart = do failIfInQuoteContext InDoubleQuote - char '\8220' <|> - (try $ do char '"' - notFollowedBy (oneOf " \t\n") - return '"') + try $ do char '"' + notFollowedBy (oneOf " \t\n") + return '"' doubleQuoteEnd :: GenParser Char st Char -doubleQuoteEnd = char '\8221' <|> char '"' +doubleQuoteEnd = char '"' ellipses :: GenParser Char st Inline ellipses = oneOfStrings ["...", " . . . ", ". . .", " . . ."] >> return Ellipses |