git.iko.soy/typeable/pandoc
on master help sign in
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.

commitd9eff99f27bb6426534651c9ff85b2b4354e6d16 authorJohn MacFarlane <jgm@berkeley.edu> dateTue 7 Jan 2014, 23:39 (13 years ago) parent3cad665
1 file changed+3−3
src/Text/Pandoc/Readers/Markdown.hs+3−3
src/Text/Pandoc/Readers/Markdown.hs+3−3
@@ -1126,12 +1126,12 @@ multilineTableHeader headless = try $ do
11261126 then liftM (map (:[]) . tail .
11271127 splitStringByIndices (init indices)) $ lookAhead anyLine
11281128 else return $ transpose $ map
1129− (\ln -> tail $ splitStringByIndices (init indices) ln)
1129+ (tail . splitStringByIndices (init indices))
11301130 rawContent
11311131 let aligns = zipWith alignType rawHeadsList lengths
11321132 let rawHeads = if headless
11331133 then replicate (length dashes) ""
1134− else map unwords rawHeadsList
1134+ else map (unlines . map trim) rawHeadsList
11351135 heads <- fmap sequence $
11361136 mapM (parseFromString (mconcat <$> many plain)) $
11371137 map trim rawHeads
@@ -1188,7 +1188,7 @@ gridTableHeader headless = try $ do
11881188 -- RST does not have a notion of alignments
11891189 let rawHeads = if headless
11901190 then replicate (length dashes) ""
1191− else map unwords $ transpose
1191+ else map (unlines . map trim) $ transpose
11921192 $ map (gridTableSplitLine indices) rawContent
11931193 heads <- fmap sequence $ mapM (parseFromString parseBlocks . trim) rawHeads
11941194 return (heads, aligns, indices)