git.iko.soy/typeable/pandoc
on master help sign in
In parsing smart quotes, leave unicode curly quotes alone.
5d9d7f3John MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+12−14
@@ -67,7 +67,7 @@ setextHChars = "=-"
67
67
68-- treat these as potentially non-text when parsing inline:
68-- treat these as potentially non-text when parsing inline:
69specialChars :: [Char]
69specialChars :: [Char]
70−specialChars = "\\[]*_~`<>$!^-.&'\"\8216\8217\8220\8221;"
70+specialChars = "\\[]*_~`<>$!^-.&'\";"
71
71
72--
72--
73-- auxiliary functions
73-- auxiliary functions
@@ -1070,30 +1070,28 @@ failIfInQuoteContext context = do
1070singleQuoteStart :: GenParser Char ParserState Char
1070singleQuoteStart :: GenParser Char ParserState Char
1071singleQuoteStart = do
1071singleQuoteStart = do
1072 failIfInQuoteContext InSingleQuote
1072 failIfInQuoteContext InSingleQuote
1073− char '\8216' <|>
1074− (try $ do char '\''
1073+ try $ do char '\''
1075− notFollowedBy (oneOf ")!],.;:-? \t\n")
1074+ notFollowedBy (oneOf ")!],.;:-? \t\n")
1076− notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >>
1075+ notFollowedBy (try (oneOfStrings ["s","t","m","ve","ll","re"] >>
1077− satisfy (not . isAlphaNum)))
1076+ satisfy (not . isAlphaNum)))
1078− -- possess/contraction
1077+ -- possess/contraction
1079− return '\'')
1078+ return '\''
1080
1079
1081singleQuoteEnd :: GenParser Char st Char
1080singleQuoteEnd :: GenParser Char st Char
1082singleQuoteEnd = try $ do
1081singleQuoteEnd = try $ do
1083− char '\8217' <|> char '\''
1082+ char '\''
1084 notFollowedBy alphaNum
1083 notFollowedBy alphaNum
1085 return '\''
1084 return '\''
1086
1085
1087doubleQuoteStart :: GenParser Char ParserState Char
1086doubleQuoteStart :: GenParser Char ParserState Char
1088doubleQuoteStart = do
1087doubleQuoteStart = do
1089 failIfInQuoteContext InDoubleQuote
1088 failIfInQuoteContext InDoubleQuote
1090− char '\8220' <|>
1091− (try $ do char '"'
1089+ try $ do char '"'
1092− notFollowedBy (oneOf " \t\n")
1090+ notFollowedBy (oneOf " \t\n")
1093− return '"')
1091+ return '"'
1094
1092
1095doubleQuoteEnd :: GenParser Char st Char
1093doubleQuoteEnd :: GenParser Char st Char
1096−doubleQuoteEnd = char '\8221' <|> char '"'
1094+doubleQuoteEnd = char '"'
1097
1095
1098ellipses :: GenParser Char st Inline
1096ellipses :: GenParser Char st Inline
1099ellipses = oneOfStrings ["...", " . . . ", ". . .", " . . ."] >> return Ellipses
1097ellipses = oneOfStrings ["...", " . . . ", ". . .", " . . ."] >> return Ellipses