aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Readers/Muse.hs2
-rw-r--r--test/Tests/Readers/Muse.hs11
2 files changed, 12 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/Muse.hs b/src/Text/Pandoc/Readers/Muse.hs
index 8ab708255..7aef9bd6d 100644
--- a/src/Text/Pandoc/Readers/Muse.hs
+++ b/src/Text/Pandoc/Readers/Muse.hs
@@ -703,7 +703,7 @@ tableParseRow :: PandocMonad m
tableParseRow n = try $ sequence <$> tableCells
where tableCells = (:) <$> tableCell sep <*> (tableCells <|> fmap pure (tableCell eol))
tableCell p = try $ fmap B.plain . trimInlinesF . mconcat <$> manyTill inline' p
- sep = try $ many1 spaceChar *> count n (char '|') *> (void (many1 spaceChar) <|> void (lookAhead eol))
+ sep = try $ many1 spaceChar *> count n (char '|') *> (void (lookAhead $ many1 spaceChar) <|> void (lookAhead eol))
-- | Parse a table header row.
tableParseHeader :: PandocMonad m => MuseParser m (F MuseTableElement)
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index 958a74915..35047ad4f 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -891,6 +891,17 @@ tests =
[[plain "", plain "Foo"],
[plain "", plain ""],
[plain "bar", plain ""]]
+ , "Empty cell in the middle" =:
+ T.unlines
+ [ " 1 | 2 | 3"
+ , " 4 | | 6"
+ , " 7 | 8 | 9"
+ ] =?>
+ table mempty [(AlignDefault, 0.0), (AlignDefault, 0.0), (AlignDefault, 0.0)]
+ []
+ [[plain "1", plain "2", plain "3"],
+ [plain "4", mempty, plain "6"],
+ [plain "7", plain "8", plain "9"]]
]
, testGroup "Lists"
[ "Bullet list" =: