Markdown: Improved computation of relative cell widths in pipe tables.
This commit is contained in:
parent
e86c337356
commit
7093a3b44c
3 changed files with 5 additions and 5 deletions
|
@ -1353,7 +1353,7 @@ pipeTable = try $ do
|
|||
numColumns <- getOption readerColumns
|
||||
let widths = if maxlength > numColumns
|
||||
then map (\len ->
|
||||
fromIntegral (len + 1) / fromIntegral (sum seplengths))
|
||||
fromIntegral len / fromIntegral (sum seplengths))
|
||||
seplengths
|
||||
else replicate (length aligns) 0.0
|
||||
return (aligns, widths, heads', sequence lines'')
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
^D
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width: 15%" />
|
||||
<col style="width: 8%" />
|
||||
<col style="width: 76%" />
|
||||
<col style="width: 14%" />
|
||||
<col style="width: 7%" />
|
||||
<col style="width: 77%" />
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr class="header">
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
,[[Plain [Str "4"]]
|
||||
,[Plain [Str "44"]]]]
|
||||
,Para [Str "Long",Space,Str "pipe",Space,Str "table",Space,Str "with",Space,Str "relative",Space,Str "widths:"]
|
||||
,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.1639344262295082,0.18032786885245902,0.6557377049180328]
|
||||
,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.15517241379310345,0.1724137931034483,0.6724137931034483]
|
||||
[[Plain [Str "Default1"]]
|
||||
,[Plain [Str "Default2"]]
|
||||
,[Plain [Str "Default3"]]]
|
||||
|
|
Loading…
Reference in a new issue