RST, Markdown writers: Fixed rendering of grid tables with blank rows.
Closes #2615.
This commit is contained in:
parent
a81b0932e5
commit
a796538d84
2 changed files with 2 additions and 2 deletions
|
@ -572,7 +572,7 @@ gridTable opts headless _aligns widths headers' rawRows = do
|
||||||
else widths
|
else widths
|
||||||
let widthsInChars = map (floor . (fromIntegral (writerColumns opts) *)) widths'
|
let widthsInChars = map (floor . (fromIntegral (writerColumns opts) *)) widths'
|
||||||
let hpipeBlocks blocks = hcat [beg, middle, end]
|
let hpipeBlocks blocks = hcat [beg, middle, end]
|
||||||
where h = maximum (map height blocks)
|
where h = maximum (1 : map height blocks)
|
||||||
sep' = lblock 3 $ vcat (map text $ replicate h " | ")
|
sep' = lblock 3 $ vcat (map text $ replicate h " | ")
|
||||||
beg = lblock 2 $ vcat (map text $ replicate h "| ")
|
beg = lblock 2 $ vcat (map text $ replicate h "| ")
|
||||||
end = lblock 2 $ vcat (map text $ replicate h " |")
|
end = lblock 2 $ vcat (map text $ replicate h " |")
|
||||||
|
|
|
@ -267,7 +267,7 @@ blockToRST (Table caption _ widths headers rows) = do
|
||||||
then map ((+2) . numChars) $ transpose (headers' : rawRows)
|
then map ((+2) . numChars) $ transpose (headers' : rawRows)
|
||||||
else map (floor . (fromIntegral (writerColumns opts) *)) widths
|
else map (floor . (fromIntegral (writerColumns opts) *)) widths
|
||||||
let hpipeBlocks blocks = hcat [beg, middle, end]
|
let hpipeBlocks blocks = hcat [beg, middle, end]
|
||||||
where h = maximum (map height blocks)
|
where h = maximum (1 : map height blocks)
|
||||||
sep' = lblock 3 $ vcat (map text $ replicate h " | ")
|
sep' = lblock 3 $ vcat (map text $ replicate h " | ")
|
||||||
beg = lblock 2 $ vcat (map text $ replicate h "| ")
|
beg = lblock 2 $ vcat (map text $ replicate h "| ")
|
||||||
end = lblock 2 $ vcat (map text $ replicate h " |")
|
end = lblock 2 $ vcat (map text $ replicate h " |")
|
||||||
|
|
Loading…
Add table
Reference in a new issue