git.iko.soy/typeable/pandoc
on master help sign in
Further improvements in smart quotes.

Improves heuristic for detection of an "open double quote." Closes #2103.

commitd14c5f94df490996d12f8a56e29f927b9f9549e8 authorJohn MacFarlane <jgm@berkeley.edu> dateThu 29 Apr 2021, 08:48 (6 years ago) parent80e2e88
2 files changed+10−2
src/Text/Pandoc/Parsing.hs+2−2 test/command/2103.md+8
src/Text/Pandoc/Parsing.hs+2−2
@@ -1447,7 +1447,7 @@ singleQuoteStart = do
14471447 guard =<< notAfterString
14481448 try $ do
14491449 charOrRef "'\8216\145"
1450− notFollowedBy (satisfy isSpaceChar)
1450+ void $ lookAhead (satisfy (not . isSpaceChar))
14511451
14521452singleQuoteEnd :: Stream s m Char
14531453 => ParserT s st m ()
@@ -1463,7 +1463,7 @@ doubleQuoteStart = do
14631463 failIfInQuoteContext InDoubleQuote
14641464 guard =<< notAfterString
14651465 try $ do charOrRef "\"\8220\147"
1466− notFollowedBy (satisfy isSpaceChar)
1466+ void $ lookAhead (satisfy (not . isSpaceChar))
14671467
14681468doubleQuoteEnd :: Stream s m Char
14691469 => ParserT s st m ()
test/command/2103.mdnew file+8
@@ -0,0 +1,8 @@
1+```
2+pandoc -t latex
3+| A happy pandoc user said "fix this bug please
4+| or I'll go crazy!"
5+^D
6+A happy pandoc user said ``fix this bug please\\
7+or I'll go crazy!''
8+```