git.iko.soy/typeable/pandoc
on master help sign in
Minor tweaks to smart quoting code.
5a48839fiddlosopher
src/Text/Pandoc/Readers/Markdown.hs+3−4
@@ -759,14 +759,12 @@ withQuoteContext context parser = do
759singleQuoted = try $ do
759singleQuoted = try $ do
760 singleQuoteStart
760 singleQuoteStart
761 withQuoteContext InSingleQuote $ do
761 withQuoteContext InSingleQuote $ do
762− notFollowedBy space
763 result <- many1Till inline singleQuoteEnd
762 result <- many1Till inline singleQuoteEnd
764 return $ Quoted SingleQuote $ normalizeSpaces result
763 return $ Quoted SingleQuote $ normalizeSpaces result
765
764
766doubleQuoted = try $ do
765doubleQuoted = try $ do
767 doubleQuoteStart
766 doubleQuoteStart
768 withQuoteContext InDoubleQuote $ do
767 withQuoteContext InDoubleQuote $ do
769− notFollowedBy space
770 result <- many1Till inline doubleQuoteEnd
768 result <- many1Till inline doubleQuoteEnd
771 return $ Quoted DoubleQuote $ normalizeSpaces result
769 return $ Quoted DoubleQuote $ normalizeSpaces result
772
770
@@ -779,15 +777,16 @@ failIfInQuoteContext context = do
779singleQuoteStart = try $ do
777singleQuoteStart = try $ do
780 failIfInQuoteContext InSingleQuote
778 failIfInQuoteContext InSingleQuote
781 char '\'' <|> char '\8216'
779 char '\'' <|> char '\8216'
782− notFollowedBy (oneOf ")!],.;:-?")
780+ notFollowedBy (oneOf ")!],.;:-? \t\n")
783
781
784singleQuoteEnd = try $ do
782singleQuoteEnd = try $ do
785 char '\'' <|> char '\8217'
783 char '\'' <|> char '\8217'
786 notFollowedBy alphaNum
784 notFollowedBy alphaNum
787
785
788−doubleQuoteStart = do
786+doubleQuoteStart = try $ do
789 failIfInQuoteContext InDoubleQuote
787 failIfInQuoteContext InDoubleQuote
790 char '"' <|> char '\8220'
788 char '"' <|> char '\8220'
789+ notFollowedBy (oneOf " \t\n")
791
790
792doubleQuoteEnd = char '"' <|> char '\8221'
791doubleQuoteEnd = char '"' <|> char '\8221'
793
792