git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader: Allow hard line breaks in table cells.
d9eff99John MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+3−3
@@ -1126,12 +1126,12 @@ multilineTableHeader headless = try $ do
1126 then liftM (map (:[]) . tail .
1126 then liftM (map (:[]) . tail .
1127 splitStringByIndices (init indices)) $ lookAhead anyLine
1127 splitStringByIndices (init indices)) $ lookAhead anyLine
1128 else return $ transpose $ map
1128 else return $ transpose $ map
1129− (\ln -> tail $ splitStringByIndices (init indices) ln)
1129+ (tail . splitStringByIndices (init indices))
1130 rawContent
1130 rawContent
1131 let aligns = zipWith alignType rawHeadsList lengths
1131 let aligns = zipWith alignType rawHeadsList lengths
1132 let rawHeads = if headless
1132 let rawHeads = if headless
1133 then replicate (length dashes) ""
1133 then replicate (length dashes) ""
1134− else map unwords rawHeadsList
1134+ else map (unlines . map trim) rawHeadsList
1135 heads <- fmap sequence $
1135 heads <- fmap sequence $
1136 mapM (parseFromString (mconcat <$> many plain)) $
1136 mapM (parseFromString (mconcat <$> many plain)) $
1137 map trim rawHeads
1137 map trim rawHeads
@@ -1188,7 +1188,7 @@ gridTableHeader headless = try $ do
1188 -- RST does not have a notion of alignments
1188 -- RST does not have a notion of alignments
1189 let rawHeads = if headless
1189 let rawHeads = if headless
1190 then replicate (length dashes) ""
1190 then replicate (length dashes) ""
1191− else map unwords $ transpose
1191+ else map (unlines . map trim) $ transpose
1192 $ map (gridTableSplitLine indices) rawContent
1192 $ map (gridTableSplitLine indices) rawContent
1193 heads <- fmap sequence $ mapM (parseFromString parseBlocks . trim) rawHeads
1193 heads <- fmap sequence $ mapM (parseFromString parseBlocks . trim) rawHeads
1194 return (heads, aligns, indices)
1194 return (heads, aligns, indices)