From f0a991a22be9b82e192d63bf80bbe39679bb2e07 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 22 Feb 2021 21:17:22 -0800 Subject: T.P.CSV: fix parsing of unquoted values. Previously we didn't allow unescaped quotes in unquoted values, but they are allowed. Closes #7112. --- src/Text/Pandoc/CSV.hs | 3 +-- test/command/7112.md | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 test/command/7112.md diff --git a/src/Text/Pandoc/CSV.hs b/src/Text/Pandoc/CSV.hs index ec212fa9a..2bd21bcfb 100644 --- a/src/Text/Pandoc/CSV.hs +++ b/src/Text/Pandoc/CSV.hs @@ -68,8 +68,7 @@ escaped opts = try $ pCSVUnquotedCell :: CSVOptions -> Parser Text pCSVUnquotedCell opts = T.pack <$> - many (satisfy (\c -> c /= csvDelim opts && c /= '\r' && c /= '\n' - && c /= csvQuote opts)) + many (satisfy (\c -> c /= csvDelim opts && c /= '\r' && c /= '\n')) pCSVDelim :: CSVOptions -> Parser () pCSVDelim opts = do diff --git a/test/command/7112.md b/test/command/7112.md new file mode 100644 index 000000000..a75b9250a --- /dev/null +++ b/test/command/7112.md @@ -0,0 +1,15 @@ +``` +% pandoc -f rst +.. csv-table:: + + setting, ``echo PATH="path"`` +^D + + + + + + + +
settingecho PATH="path"
+``` -- cgit v1.2.3