Minor tweaks to smart quoting code.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@497 788f1e2b-df1e-0410-8736-df70ead52e1b
This commit is contained in:
fiddlosopher 2007-01-16 23:51:57 +00:00
parent 8c257385ac
commit 5a48839168

View file

@ -759,14 +759,12 @@ withQuoteContext context parser = do
singleQuoted = try $ do
singleQuoteStart
withQuoteContext InSingleQuote $ do
notFollowedBy space
result <- many1Till inline singleQuoteEnd
return $ Quoted SingleQuote $ normalizeSpaces result
doubleQuoted = try $ do
doubleQuoteStart
withQuoteContext InDoubleQuote $ do
notFollowedBy space
result <- many1Till inline doubleQuoteEnd
return $ Quoted DoubleQuote $ normalizeSpaces result
@ -779,15 +777,16 @@ failIfInQuoteContext context = do
singleQuoteStart = try $ do
failIfInQuoteContext InSingleQuote
char '\'' <|> char '\8216'
notFollowedBy (oneOf ")!],.;:-?")
notFollowedBy (oneOf ")!],.;:-? \t\n")
singleQuoteEnd = try $ do
char '\'' <|> char '\8217'
notFollowedBy alphaNum
doubleQuoteStart = do
doubleQuoteStart = try $ do
failIfInQuoteContext InDoubleQuote
char '"' <|> char '\8220'
notFollowedBy (oneOf " \t\n")
doubleQuoteEnd = char '"' <|> char '\8221'