diff options
| author | John MacFarlane <[email protected]> | 2023-03-01 09:25:31 -0800 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-03-01 09:25:31 -0800 |
| commit | 6b906879af8d6355c7998da439c57aae909e62c9 (patch) | |
| tree | f89b3e92fcb3494bbb0ee19db8cc07c53ef38dba /src | |
| parent | c8147fc58354e9fdf117240efc79801b6b5d3658 (diff) | |
Make sure TSV reader doesn't gobble tabs as whitespace.
Closes #8661.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/CSV.hs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/CSV.hs b/src/Text/Pandoc/CSV.hs index ffac342cb..b0ac2e3f1 100644 --- a/src/Text/Pandoc/CSV.hs +++ b/src/Text/Pandoc/CSV.hs @@ -80,7 +80,10 @@ pCSVUnquotedCell opts = T.pack <$> pCSVDelim :: CSVOptions -> Parser () pCSVDelim opts = do char (csvDelim opts) - unless (csvKeepSpace opts) $ skipMany (oneOf " \t") + let spaceChar = case csvDelim opts of + '\t' -> char ' ' + _ -> oneOf " \t" + unless (csvKeepSpace opts) $ skipMany spaceChar endline :: Parser () endline = do |
