git.iko.soy/typeable/pandoc
on master help sign in
Fixed bug in smart quoting: recognize ' in contractions like
e6cc2aafiddlosopher
src/Text/Pandoc/Readers/Markdown.hs+7−3
@@ -776,9 +776,13 @@ failIfInQuoteContext context = do
776
776
777singleQuoteStart = try $ do
777singleQuoteStart = try $ do
778 failIfInQuoteContext InSingleQuote
778 failIfInQuoteContext InSingleQuote
779+ char '\8216' <|> do
779− char '\'' <|> char '\8216'
780+ char '\''
780− notFollowedBy (oneOf ")!],.;:-? \t\n")
781+ notFollowedBy (oneOf ")!],.;:-? \t\n")
782+ notFollowedBy (try (do -- possessive or contraction
783+ oneOf "sStT"
781− notFollowedBy (try (do{oneOf "sS"; satisfy (not . isAlphaNum)}))
784+ satisfy (not . isAlphaNum)))
785+ return '\''
782
786
783singleQuoteEnd = try $ do
787singleQuoteEnd = try $ do
784 char '\'' <|> char '\8217'
788 char '\'' <|> char '\8217'