Markdown reader: Allow hard line breaks in table cells.
The \-newline form must be used; the two-space+newline form won't work, since in a table cell nearly every line ends with two spaces.
This commit is contained in:
parent
3cad665afb
commit
d9eff99f27
1 changed files with 3 additions and 3 deletions
|
@ -1126,12 +1126,12 @@ multilineTableHeader headless = try $ do
|
||||||
then liftM (map (:[]) . tail .
|
then liftM (map (:[]) . tail .
|
||||||
splitStringByIndices (init indices)) $ lookAhead anyLine
|
splitStringByIndices (init indices)) $ lookAhead anyLine
|
||||||
else return $ transpose $ map
|
else return $ transpose $ map
|
||||||
(\ln -> tail $ splitStringByIndices (init indices) ln)
|
(tail . splitStringByIndices (init indices))
|
||||||
rawContent
|
rawContent
|
||||||
let aligns = zipWith alignType rawHeadsList lengths
|
let aligns = zipWith alignType rawHeadsList lengths
|
||||||
let rawHeads = if headless
|
let rawHeads = if headless
|
||||||
then replicate (length dashes) ""
|
then replicate (length dashes) ""
|
||||||
else map unwords rawHeadsList
|
else map (unlines . map trim) rawHeadsList
|
||||||
heads <- fmap sequence $
|
heads <- fmap sequence $
|
||||||
mapM (parseFromString (mconcat <$> many plain)) $
|
mapM (parseFromString (mconcat <$> many plain)) $
|
||||||
map trim rawHeads
|
map trim rawHeads
|
||||||
|
@ -1188,7 +1188,7 @@ gridTableHeader headless = try $ do
|
||||||
-- RST does not have a notion of alignments
|
-- RST does not have a notion of alignments
|
||||||
let rawHeads = if headless
|
let rawHeads = if headless
|
||||||
then replicate (length dashes) ""
|
then replicate (length dashes) ""
|
||||||
else map unwords $ transpose
|
else map (unlines . map trim) $ transpose
|
||||||
$ map (gridTableSplitLine indices) rawContent
|
$ map (gridTableSplitLine indices) rawContent
|
||||||
heads <- fmap sequence $ mapM (parseFromString parseBlocks . trim) rawHeads
|
heads <- fmap sequence $ mapM (parseFromString parseBlocks . trim) rawHeads
|
||||||
return (heads, aligns, indices)
|
return (heads, aligns, indices)
|
||||||
|
|
Loading…
Add table
Reference in a new issue