Skip to content

Commit

Permalink
AsciiDoc writer: Correctly handle empty table cells.
Browse files Browse the repository at this point in the history
Closes #1245.
  • Loading branch information
jgm committed May 4, 2014
1 parent abd3a03 commit fde52c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Text/Pandoc/Writers/AsciiDoc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ blockToAsciiDoc opts (Table caption aligns widths headers rows) = do
let makeCell [Plain x] = do d <- blockListToAsciiDoc opts [Plain x]
return $ text "|" <> chomp d
makeCell [Para x] = makeCell [Plain x]
makeCell [] = return $ text "|"
makeCell _ = return $ text "|" <> "[multiblock cell omitted]"
let makeRow cells = hsep `fmap` mapM makeCell cells
rows' <- mapM makeRow rows
Expand All @@ -227,7 +228,7 @@ blockToAsciiDoc opts (Table caption aligns widths headers rows) = do
else 100000
let maxwidth = maximum $ map offset (head':rows')
let body = if maxwidth > colwidth then vsep rows' else vcat rows'
let border = text $ "|" ++ replicate ((min maxwidth colwidth) - 1) '='
let border = text $ "|" ++ replicate (max 5 (min maxwidth colwidth) - 1) '='
return $
caption'' $$ tablespec $$ border $$ head'' $$ body $$ border $$ blankline
blockToAsciiDoc opts (BulletList items) = do
Expand Down

0 comments on commit fde52c2

Please sign in to comment.