diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-03-09 08:44:31 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-03-09 08:44:31 -0800 |
commit | 6e950a8eb5001314869013395c9c72ee05079110 (patch) | |
tree | 9363247cb976566d4e02ba8563f7f230444d1741 /src/Text/Pandoc | |
parent | 4ed64835cb475f3da80ed7b729516c7a90891d94 (diff) | |
download | pandoc-6e950a8eb5001314869013395c9c72ee05079110.tar.gz |
Markdown reader: allow `+` separators in pipe table cells.
We already allowed them in the header, but not in the body
rows, for some reason. This gives compatibility with org-mode
tables.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 0eeda0fee..6caf1728c 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -1382,16 +1382,14 @@ pipeTableRow' = do skipMany spaceChar openPipe <- (True <$ char '|') <|> return False let cell = mconcat <$> - many (notFollowedBy (blankline <|> char '|') >> inline) - first <- cell - rest <- many $ sepPipe *> cell + many (notFollowedBy (blankline <|> oneOf "+|") >> inline) + cells <- cell `sepBy1` sepPipe -- surrounding pipes needed for a one-column table: - guard $ not (null rest && not openPipe) + guard $ not (length cells == 1 && not openPipe) optional (char '|') blankline - let cells = sequence (first:rest) return $ do - cells' <- cells + cells' <- sequence cells return $ map (\ils -> case trimInlines ils of |