diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-05-09 10:00:34 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2018-05-09 10:00:34 -0700 |
commit | 81881ce4708f06ca53088d95ff249b48f2b2e88d (patch) | |
tree | ebfc555f8170b28941b97c8768d09f97e98bd71b | |
parent | 5f33d2e0cd9f19566904c93be04f586de811dd75 (diff) | |
download | pandoc-81881ce4708f06ca53088d95ff249b48f2b2e88d.tar.gz |
Parsing: Lookahead for non-whitespace after single/double quote start.
Closes #4637.
-rw-r--r-- | src/Text/Pandoc/Parsing.hs | 6 | ||||
-rw-r--r-- | test/command/4637.md | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Parsing.hs b/src/Text/Pandoc/Parsing.hs index fa6baf1c7..05f4f7d36 100644 --- a/src/Text/Pandoc/Parsing.hs +++ b/src/Text/Pandoc/Parsing.hs @@ -1366,7 +1366,9 @@ singleQuoteStart = do failIfInQuoteContext InSingleQuote -- single quote start can't be right after str guard =<< notAfterString - () <$ charOrRef "'\8216\145" + try $ do + charOrRef "'\8216\145" + notFollowedBy (oneOf [' ', '\t', '\n']) singleQuoteEnd :: Stream s m Char => ParserT s st m () @@ -1379,7 +1381,7 @@ doubleQuoteStart :: (HasQuoteContext st m, Stream s m Char) doubleQuoteStart = do failIfInQuoteContext InDoubleQuote try $ do charOrRef "\"\8220\147" - notFollowedBy . satisfy $ flip elem [' ', '\t', '\n'] + notFollowedBy (oneOf [' ', '\t', '\n']) doubleQuoteEnd :: Stream s m Char => ParserT s st m () diff --git a/test/command/4637.md b/test/command/4637.md new file mode 100644 index 000000000..892b060a1 --- /dev/null +++ b/test/command/4637.md @@ -0,0 +1,6 @@ +``` +% pandoc -t latex +more \indextext{dogs}' than \indextext{cats}' +^D +more \indextext{dogs}' than \indextext{cats}' +``` |