aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-07-21 10:20:15 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-07-21 10:20:15 -0700
commit942e3ee1f9ce3593b3ce3cc32c7ed7039aee205a (patch)
tree76227c0963b136a44849d28cb36e91a2008d8ab5 /src
parentfe315a8290a9d192ef6fe707553f3baaafb3d035 (diff)
downloadpandoc-942e3ee1f9ce3593b3ce3cc32c7ed7039aee205a.tar.gz
RST reader: fix csv tables with multiline cells.
Closes #6549.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 7c25be486..25682a500 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -879,7 +879,12 @@ csvTableDirective top fields rawcsv = do
Left e ->
throwError $ PandocParsecError "csv table" e
Right rawrows -> do
- let parseCell = parseFromString' (plain <|> return mempty)
+ let singleParaToPlain bs =
+ case B.toList bs of
+ [Para ils] -> B.fromList [Plain ils]
+ _ -> bs
+ let parseCell t = singleParaToPlain
+ <$> parseFromString' parseBlocks (t <> "\n\n")
let parseRow = mapM parseCell
rows <- mapM parseRow rawrows
let (headerRow,bodyRows,numOfCols) =