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.
This commit is contained in:
parent
4ed64835cb
commit
6e950a8eb5
1 changed files with 4 additions and 6 deletions
|
@ -1382,16 +1382,14 @@ pipeTableRow' = do
|
||||||
skipMany spaceChar
|
skipMany spaceChar
|
||||||
openPipe <- (True <$ char '|') <|> return False
|
openPipe <- (True <$ char '|') <|> return False
|
||||||
let cell = mconcat <$>
|
let cell = mconcat <$>
|
||||||
many (notFollowedBy (blankline <|> char '|') >> inline)
|
many (notFollowedBy (blankline <|> oneOf "+|") >> inline)
|
||||||
first <- cell
|
cells <- cell `sepBy1` sepPipe
|
||||||
rest <- many $ sepPipe *> cell
|
|
||||||
-- surrounding pipes needed for a one-column table:
|
-- surrounding pipes needed for a one-column table:
|
||||||
guard $ not (null rest && not openPipe)
|
guard $ not (length cells == 1 && not openPipe)
|
||||||
optional (char '|')
|
optional (char '|')
|
||||||
blankline
|
blankline
|
||||||
let cells = sequence (first:rest)
|
|
||||||
return $ do
|
return $ do
|
||||||
cells' <- cells
|
cells' <- sequence cells
|
||||||
return $ map
|
return $ map
|
||||||
(\ils ->
|
(\ils ->
|
||||||
case trimInlines ils of
|
case trimInlines ils of
|
||||||
|
|
Loading…
Reference in a new issue