git.iko.soy/typeable/pandoc
on master help sign in
Markdown reader/writer: spacing adjustments in tables.

* Markdown writer now includes a blank line at the end of the row in a single-row multiline table, to prevent it from being interpreted as a simple table. Closes #4578. * Markdown reader does a better job computing the relative width of the last column in a multiline table, so we can round-trip tables without constantly shrinking the last column.

commit7fbe473b2e3b3b2b94be810b6385475c056a304a authorJohn MacFarlane <jgm@berkeley.edu> dateSat 21 Apr 2018, 13:06 (8 years ago) parent229db80
25 files changed+174−152
src/Text/Pandoc/Readers/Markdown.hs+8−3 src/Text/Pandoc/Writers/Markdown.hs+4−1 test/command/3348.md+1−1 test/command/4578.md+14 test/tables-rstsubset.native+6−6 test/tables.asciidoc+3−3 test/tables.context+8−8 test/tables.custom+3−3 test/tables.docbook4+3−3 test/tables.docbook5+3−3 test/tables.haddock+30−30 test/tables.html4+6−6 test/tables.html5+6−6 test/tables.icml+3−3 test/tables.jats+3−3 test/tables.latex+9−9 test/tables.man+3−3 test/tables.mediawiki+3−3 test/tables.ms+3−3 test/tables.native+3−3 test/tables.plain+8−8 test/tables.rst+30−30 test/tables.rtf+8−8 test/tables.texinfo+3−3 test/tables.textile+3−3
src/Text/Pandoc/Readers/Markdown.hs+8−3
@@ -1341,11 +1341,16 @@ multilineTableHeader headless = try $ do
13411341 newline
13421342 let (lengths, lines') = unzip dashes
13431343 let indices = scanl (+) (length initSp) lines'
1344+ -- compensate for the fact that intercolumn spaces are
1345+ -- not included in the last index:
1346+ let indices' = case reverse indices of
1347+ [] -> []
1348+ (x:xs) -> reverse (x+1:xs)
13441349 rawHeadsList <- if headless
13451350 then fmap (map (:[]) . tail .
1346− splitStringByIndices (init indices)) $ lookAhead anyLine
1351+ splitStringByIndices (init indices')) $ lookAhead anyLine
13471352 else return $ transpose $ map
1348− (tail . splitStringByIndices (init indices))
1353+ (tail . splitStringByIndices (init indices'))
13491354 rawContent
13501355 let aligns = zipWith alignType rawHeadsList lengths
13511356 let rawHeads = if headless
@@ -1353,7 +1358,7 @@ multilineTableHeader headless = try $ do
13531358 else map (unlines . map trim) rawHeadsList
13541359 heads <- fmap sequence $
13551360 mapM ((parseFromString' (mconcat <$> many plain)).trim) rawHeads
1356− return (heads, aligns, indices)
1361+ return (heads, aligns, indices')
13571362
13581363-- Parse a grid table: starts with row of '-' on top, then header
13591364-- (which may be grid), then the rows,
src/Text/Pandoc/Writers/Markdown.hs+4−1
@@ -732,7 +732,10 @@ pandocTable opts multiline headless aligns widths rawHeaders rawRows = do
732732 then empty
733733 else border <> cr <> head'
734734 let body = if multiline
735− then vsep rows'
735+ then vsep rows' $$
736+ if length rows' < 2
737+ then blankline -- #4578
738+ else empty
736739 else vcat rows'
737740 let bottom = if headless
738741 then underline
test/command/3348.md+1−1
@@ -7,7 +7,7 @@
77 line of text
88 ----- ------------------------------------------------
99^D
10−[Table [] [AlignRight,AlignLeft] [8.333333333333333e-2,0.6666666666666666]
10+[Table [] [AlignRight,AlignLeft] [8.333333333333333e-2,0.6805555555555556]
1111 [[]
1212 ,[]]
1313 [[[Plain [Str "foo"]]
test/command/4578.mdnew file+14
@@ -0,0 +1,14 @@
1+```
2+% pandoc -t markdown
3+ ------ ------- --------------- ---------------------
4+ One row 12.0 Example of a row that
5+ spans multiple lines.
6+
7+ ------ ------- --------------- ---------------------
8+^D
9+ ------ ------- --------------- ---------------------
10+ One row 12.0 Example of a row that
11+ spans multiple lines.
12+
13+ ------ ------- --------------- ---------------------
14+```
test/tables-rstsubset.native+6−6
@@ -53,7 +53,7 @@
5353 ,[Plain [Str "1"]]
5454 ,[Plain [Str "1"]]]]
5555,Para [Str "Multiline",Space,Str "table",Space,Str "with",Space,Str "caption:"]
56−,Table [Str "Here\8217s",Space,Str "the",Space,Str "caption.",Space,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.1375,0.125,0.15,0.325]
56+,Table [Str "Here\8217s",Space,Str "the",Space,Str "caption.",Space,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.1375,0.125,0.15,0.3375]
5757 [[Plain [Str "Centered",SoftBreak,Str "Header"]]
5858 ,[Plain [Str "Left",SoftBreak,Str "Aligned"]]
5959 ,[Plain [Str "Right",SoftBreak,Str "Aligned"]]
@@ -65,9 +65,9 @@
6565 ,[[Plain [Str "Second"]]
6666 ,[Plain [Str "row"]]
6767 ,[Plain [Str "5.0"]]
68− ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",SoftBreak,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",SoftBreak,Str "between",Space,Str "rows."]]]]
68+ ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",SoftBreak,Str "rows."]]]]
6969,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "caption:"]
70−,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.1375,0.125,0.15,0.325]
70+,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.1375,0.125,0.15,0.3375]
7171 [[Plain [Str "Centered",SoftBreak,Str "Header"]]
7272 ,[Plain [Str "Left",SoftBreak,Str "Aligned"]]
7373 ,[Plain [Str "Right",SoftBreak,Str "Aligned"]]
@@ -79,7 +79,7 @@
7979 ,[[Plain [Str "Second"]]
8080 ,[Plain [Str "row"]]
8181 ,[Plain [Str "5.0"]]
82− ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",SoftBreak,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",SoftBreak,Str "between",Space,Str "rows."]]]]
82+ ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",SoftBreak,Str "rows."]]]]
8383,Para [Str "Table",Space,Str "without",Space,Str "column",Space,Str "headers:"]
8484,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [7.5e-2,7.5e-2,7.5e-2,7.5e-2]
8585 [[]
@@ -99,7 +99,7 @@
9999 ,[Plain [Str "1"]]
100100 ,[Plain [Str "1"]]]]
101101,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "column",Space,Str "headers:"]
102−,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.1375,0.125,0.15,0.325]
102+,Table [] [AlignDefault,AlignDefault,AlignDefault,AlignDefault] [0.1375,0.125,0.15,0.3375]
103103 [[]
104104 ,[]
105105 ,[]
@@ -111,4 +111,4 @@
111111 ,[[Plain [Str "Second"]]
112112 ,[Plain [Str "row"]]
113113 ,[Plain [Str "5.0"]]
114− ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",SoftBreak,Str "Note",Space,Str "the",Space,Str "blank",Space,Str "line",SoftBreak,Str "between",Space,Str "rows."]]]]]
114+ ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",SoftBreak,Str "rows."]]]]]
test/tables.asciidoc+3−3
@@ -33,7 +33,7 @@ Simple table indented two spaces:
3333Multiline table with caption:
3434
3535.Here’s the caption. It may span multiple lines.
36−[width="78%",cols="^21%,<17%,>20%,<42%",options="header",]
36+[width="80%",cols="^20%,<17%,>20%,<43%",options="header",]
3737|=======================================================================
3838|Centered Header |Left Aligned |Right Aligned |Default aligned
3939|First |row |12.0 |Example of a row that spans multiple lines.
@@ -42,7 +42,7 @@ Multiline table with caption:
4242
4343Multiline table without caption:
4444
45−[width="78%",cols="^21%,<17%,>20%,<42%",options="header",]
45+[width="80%",cols="^20%,<17%,>20%,<43%",options="header",]
4646|=======================================================================
4747|Centered Header |Left Aligned |Right Aligned |Default aligned
4848|First |row |12.0 |Example of a row that spans multiple lines.
@@ -60,7 +60,7 @@ Table without column headers:
6060
6161Multiline table without column headers:
6262
63−[width="78%",cols="^21%,<17%,>20%,42%",]
63+[width="80%",cols="^20%,<17%,>20%,43%",]
6464|=======================================================================
6565|First |row |12.0 |Example of a row that spans multiple lines.
6666|Second |row |5.0 |Here’s another one. Note the blank line between rows.
test/tables.context+8−8
@@ -118,7 +118,7 @@ Multiline table with caption:
118118\startxcell[align=middle,width={0.15\textwidth}] Centered Header \stopxcell
119119\startxcell[align=right,width={0.14\textwidth}] Left Aligned \stopxcell
120120\startxcell[align=left,width={0.16\textwidth}] Right Aligned \stopxcell
121−\startxcell[align=right,width={0.34\textwidth}] Default aligned \stopxcell
121+\startxcell[align=right,width={0.35\textwidth}] Default aligned \stopxcell
122122\stopxrow
123123\stopxtablehead
124124\startxtablebody[body]
@@ -126,7 +126,7 @@ Multiline table with caption:
126126\startxcell[align=middle,width={0.15\textwidth}] First \stopxcell
127127\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
128128\startxcell[align=left,width={0.16\textwidth}] 12.0 \stopxcell
129−\startxcell[align=right,width={0.34\textwidth}] Example of a row that spans
129+\startxcell[align=right,width={0.35\textwidth}] Example of a row that spans
130130multiple lines. \stopxcell
131131\stopxrow
132132\stopxtablebody
@@ -135,7 +135,7 @@ multiple lines. \stopxcell
135135\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
136136\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
137137\startxcell[align=left,width={0.16\textwidth}] 5.0 \stopxcell
138−\startxcell[align=right,width={0.34\textwidth}] Here's another one. Note the
138+\startxcell[align=right,width={0.35\textwidth}] Here's another one. Note the
139139blank line between rows. \stopxcell
140140\stopxrow
141141\stopxtablefoot
@@ -151,7 +151,7 @@ Multiline table without caption:
151151\startxcell[align=middle,width={0.15\textwidth}] Centered Header \stopxcell
152152\startxcell[align=right,width={0.14\textwidth}] Left Aligned \stopxcell
153153\startxcell[align=left,width={0.16\textwidth}] Right Aligned \stopxcell
154−\startxcell[align=right,width={0.34\textwidth}] Default aligned \stopxcell
154+\startxcell[align=right,width={0.35\textwidth}] Default aligned \stopxcell
155155\stopxrow
156156\stopxtablehead
157157\startxtablebody[body]
@@ -159,7 +159,7 @@ Multiline table without caption:
159159\startxcell[align=middle,width={0.15\textwidth}] First \stopxcell
160160\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
161161\startxcell[align=left,width={0.16\textwidth}] 12.0 \stopxcell
162−\startxcell[align=right,width={0.34\textwidth}] Example of a row that spans
162+\startxcell[align=right,width={0.35\textwidth}] Example of a row that spans
163163multiple lines. \stopxcell
164164\stopxrow
165165\stopxtablebody
@@ -168,7 +168,7 @@ multiple lines. \stopxcell
168168\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
169169\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
170170\startxcell[align=left,width={0.16\textwidth}] 5.0 \stopxcell
171−\startxcell[align=right,width={0.34\textwidth}] Here's another one. Note the
171+\startxcell[align=right,width={0.35\textwidth}] Here's another one. Note the
172172blank line between rows. \stopxcell
173173\stopxrow
174174\stopxtablefoot
@@ -213,7 +213,7 @@ Multiline table without column headers:
213213\startxcell[align=middle,width={0.15\textwidth}] First \stopxcell
214214\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
215215\startxcell[align=left,width={0.16\textwidth}] 12.0 \stopxcell
216−\startxcell[width={0.34\textwidth}] Example of a row that spans multiple
216+\startxcell[width={0.35\textwidth}] Example of a row that spans multiple
217217lines. \stopxcell
218218\stopxrow
219219\stopxtablebody
@@ -222,7 +222,7 @@ lines. \stopxcell
222222\startxcell[align=middle,width={0.15\textwidth}] Second \stopxcell
223223\startxcell[align=right,width={0.14\textwidth}] row \stopxcell
224224\startxcell[align=left,width={0.16\textwidth}] 5.0 \stopxcell
225−\startxcell[width={0.34\textwidth}] Here's another one. Note the blank line
225+\startxcell[width={0.35\textwidth}] Here's another one. Note the blank line
226226between rows. \stopxcell
227227\stopxrow
228228\stopxtablefoot
test/tables.custom+3−3
@@ -95,7 +95,7 @@ It may span multiple lines.</caption>
9595<col width="15%" />
9696<col width="14%" />
9797<col width="16%" />
98−<col width="34%" />
98+<col width="35%" />
9999<tr class="header">
100100<th align="center">Centered
101101Header</th>
@@ -127,7 +127,7 @@ the blank line between rows.</td>
127127<col width="15%" />
128128<col width="14%" />
129129<col width="16%" />
130−<col width="34%" />
130+<col width="35%" />
131131<tr class="header">
132132<th align="center">Centered
133133Header</th>
@@ -182,7 +182,7 @@ the blank line between rows.</td>
182182<col width="15%" />
183183<col width="14%" />
184184<col width="16%" />
185−<col width="34%" />
185+<col width="35%" />
186186<tr class="odd">
187187<td align="center">First</td>
188188<td align="left">row</td>
test/tables.docbook4+3−3
@@ -228,7 +228,7 @@
228228 <colspec colwidth="15*" align="center" />
229229 <colspec colwidth="13*" align="left" />
230230 <colspec colwidth="16*" align="right" />
231− <colspec colwidth="33*" align="left" />
231+ <colspec colwidth="35*" align="left" />
232232 <thead>
233233 <row>
234234 <entry>
@@ -285,7 +285,7 @@
285285 <colspec colwidth="15*" align="center" />
286286 <colspec colwidth="13*" align="left" />
287287 <colspec colwidth="16*" align="right" />
288− <colspec colwidth="33*" align="left" />
288+ <colspec colwidth="35*" align="left" />
289289 <thead>
290290 <row>
291291 <entry>
@@ -397,7 +397,7 @@
397397 <colspec colwidth="15*" align="center" />
398398 <colspec colwidth="13*" align="left" />
399399 <colspec colwidth="16*" align="right" />
400− <colspec colwidth="33*" align="left" />
400+ <colspec colwidth="35*" align="left" />
401401 <tbody>
402402 <row>
403403 <entry>
test/tables.docbook5+3−3
@@ -228,7 +228,7 @@
228228 <colspec colwidth="15*" align="center" />
229229 <colspec colwidth="13*" align="left" />
230230 <colspec colwidth="16*" align="right" />
231− <colspec colwidth="33*" align="left" />
231+ <colspec colwidth="35*" align="left" />
232232 <thead>
233233 <row>
234234 <entry>
@@ -285,7 +285,7 @@
285285 <colspec colwidth="15*" align="center" />
286286 <colspec colwidth="13*" align="left" />
287287 <colspec colwidth="16*" align="right" />
288− <colspec colwidth="33*" align="left" />
288+ <colspec colwidth="35*" align="left" />
289289 <thead>
290290 <row>
291291 <entry>
@@ -397,7 +397,7 @@
397397 <colspec colwidth="15*" align="center" />
398398 <colspec colwidth="13*" align="left" />
399399 <colspec colwidth="16*" align="right" />
400− <colspec colwidth="33*" align="left" />
400+ <colspec colwidth="35*" align="left" />
401401 <tbody>
402402 <row>
403403 <entry>
test/tables.haddock+30−30
@@ -40,33 +40,33 @@ Simple table indented two spaces:
4040
4141Multiline table with caption:
4242
43−> +----------+---------+-----------+-------------------------+
44−> | Centered | Left | Right | Default aligned |
45−> | Header | Aligned | Aligned | |
46−> +==========+=========+===========+=========================+
47−> | First | row | 12.0 | Example of a row that |
48−> | | | | spans multiple lines. |
49−> +----------+---------+-----------+-------------------------+
50−> | Second | row | 5.0 | Here’s another one. |
51−> | | | | Note the blank line |
52−> | | | | between rows. |
53−> +----------+---------+-----------+-------------------------+
43+> +----------+---------+-----------+--------------------------+
44+> | Centered | Left | Right | Default aligned |
45+> | Header | Aligned | Aligned | |
46+> +==========+=========+===========+==========================+
47+> | First | row | 12.0 | Example of a row that |
48+> | | | | spans multiple lines. |
49+> +----------+---------+-----------+--------------------------+
50+> | Second | row | 5.0 | Here’s another one. Note |
51+> | | | | the blank line between |
52+> | | | | rows. |
53+> +----------+---------+-----------+--------------------------+
5454>
5555> Here’s the caption. It may span multiple lines.
5656
5757Multiline table without caption:
5858
59−> +----------+---------+-----------+-------------------------+
60−> | Centered | Left | Right | Default aligned |
61−> | Header | Aligned | Aligned | |
62−> +==========+=========+===========+=========================+
63−> | First | row | 12.0 | Example of a row that |
64−> | | | | spans multiple lines. |
65−> +----------+---------+-----------+-------------------------+
66−> | Second | row | 5.0 | Here’s another one. |
67−> | | | | Note the blank line |
68−> | | | | between rows. |
69−> +----------+---------+-----------+-------------------------+
59+> +----------+---------+-----------+--------------------------+
60+> | Centered | Left | Right | Default aligned |
61+> | Header | Aligned | Aligned | |
62+> +==========+=========+===========+==========================+
63+> | First | row | 12.0 | Example of a row that |
64+> | | | | spans multiple lines. |
65+> +----------+---------+-----------+--------------------------+
66+> | Second | row | 5.0 | Here’s another one. Note |
67+> | | | | the blank line between |
68+> | | | | rows. |
69+> +----------+---------+-----------+--------------------------+
7070
7171Table without column headers:
7272
@@ -80,11 +80,11 @@ Table without column headers:
8080
8181Multiline table without column headers:
8282
83−> +----------+---------+-----------+-------------------------+
84−> | First | row | 12.0 | Example of a row that |
85−> | | | | spans multiple lines. |
86−> +----------+---------+-----------+-------------------------+
87−> | Second | row | 5.0 | Here’s another one. |
88−> | | | | Note the blank line |
89−> | | | | between rows. |
90−> +----------+---------+-----------+-------------------------+
83+> +----------+---------+-----------+--------------------------+
84+> | First | row | 12.0 | Example of a row that |
85+> | | | | spans multiple lines. |
86+> +----------+---------+-----------+--------------------------+
87+> | Second | row | 5.0 | Here’s another one. Note |
88+> | | | | the blank line between |
89+> | | | | rows. |
90+> +----------+---------+-----------+--------------------------+
test/tables.html4+6−6
@@ -94,13 +94,13 @@
9494</tbody>
9595</table>
9696<p>Multiline table with caption:</p>
97−<table style="width:79%;">
97+<table style="width:80%;">
9898<caption>Here’s the caption. It may span multiple lines.</caption>
9999<colgroup>
100100<col width="15%" />
101101<col width="13%" />
102102<col width="16%" />
103−<col width="33%" />
103+<col width="35%" />
104104</colgroup>
105105<thead>
106106<tr class="header">
@@ -126,12 +126,12 @@
126126</tbody>
127127</table>
128128<p>Multiline table without caption:</p>
129−<table style="width:79%;">
129+<table style="width:80%;">
130130<colgroup>
131131<col width="15%" />
132132<col width="13%" />
133133<col width="16%" />
134−<col width="33%" />
134+<col width="35%" />
135135</colgroup>
136136<thead>
137137<tr class="header">
@@ -180,12 +180,12 @@
180180</tbody>
181181</table>
182182<p>Multiline table without column headers:</p>
183−<table style="width:79%;">
183+<table style="width:80%;">
184184<colgroup>
185185<col width="15%" />
186186<col width="13%" />
187187<col width="16%" />
188−<col width="33%" />
188+<col width="35%" />
189189</colgroup>
190190<tbody>
191191<tr class="odd">
test/tables.html5+6−6
@@ -94,13 +94,13 @@
9494</tbody>
9595</table>
9696<p>Multiline table with caption:</p>
97−<table style="width:79%;">
97+<table style="width:80%;">
9898<caption>Here’s the caption. It may span multiple lines.</caption>
9999<colgroup>
100100<col style="width: 15%" />
101101<col style="width: 13%" />
102102<col style="width: 16%" />
103−<col style="width: 33%" />
103+<col style="width: 35%" />
104104</colgroup>
105105<thead>
106106<tr class="header">
@@ -126,12 +126,12 @@
126126</tbody>
127127</table>
128128<p>Multiline table without caption:</p>
129−<table style="width:79%;">
129+<table style="width:80%;">
130130<colgroup>
131131<col style="width: 15%" />
132132<col style="width: 13%" />
133133<col style="width: 16%" />
134−<col style="width: 33%" />
134+<col style="width: 35%" />
135135</colgroup>
136136<thead>
137137<tr class="header">
@@ -180,12 +180,12 @@
180180</tbody>
181181</table>
182182<p>Multiline table without column headers:</p>
183−<table style="width:79%;">
183+<table style="width:80%;">
184184<colgroup>
185185<col style="width: 15%" />
186186<col style="width: 13%" />
187187<col style="width: 16%" />
188−<col style="width: 33%" />
188+<col style="width: 35%" />
189189</colgroup>
190190<tbody>
191191<tr class="odd">
test/tables.icml+3−3
@@ -395,7 +395,7 @@
395395 <Column Name="0" SingleColumnWidth="75.0" />
396396 <Column Name="1" SingleColumnWidth="68.75" />
397397 <Column Name="2" SingleColumnWidth="81.25" />
398− <Column Name="3" SingleColumnWidth="168.75" />
398+ <Column Name="3" SingleColumnWidth="175.0" />
399399 <Cell Name="0:0" AppliedCellStyle="CellStyle/Cell">
400400 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/TablePar &gt; TableHeader &gt; CenterAlign">
401401 <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
@@ -497,7 +497,7 @@
497497 <Column Name="0" SingleColumnWidth="75.0" />
498498 <Column Name="1" SingleColumnWidth="68.75" />
499499 <Column Name="2" SingleColumnWidth="81.25" />
500− <Column Name="3" SingleColumnWidth="168.75" />
500+ <Column Name="3" SingleColumnWidth="175.0" />
501501 <Cell Name="0:0" AppliedCellStyle="CellStyle/Cell">
502502 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/TablePar &gt; TableHeader &gt; CenterAlign">
503503 <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
@@ -695,7 +695,7 @@
695695 <Column Name="0" SingleColumnWidth="75.0" />
696696 <Column Name="1" SingleColumnWidth="68.75" />
697697 <Column Name="2" SingleColumnWidth="81.25" />
698− <Column Name="3" SingleColumnWidth="168.75" />
698+ <Column Name="3" SingleColumnWidth="175.0" />
699699 <Cell Name="0:0" AppliedCellStyle="CellStyle/Cell">
700700 <ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/TablePar &gt; CenterAlign">
701701 <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
test/tables.jats+3−3
@@ -122,7 +122,7 @@
122122 <col width="15*" align="center" />
123123 <col width="13*" align="left" />
124124 <col width="16*" align="right" />
125− <col width="33*" align="left" />
125+ <col width="35*" align="left" />
126126 <thead>
127127 <tr>
128128 <th>Centered Header</th>
@@ -152,7 +152,7 @@
152152 <col width="15*" align="center" />
153153 <col width="13*" align="left" />
154154 <col width="16*" align="right" />
155− <col width="33*" align="left" />
155+ <col width="35*" align="left" />
156156 <thead>
157157 <tr>
158158 <th>Centered Header</th>
@@ -208,7 +208,7 @@
208208 <col width="15*" align="center" />
209209 <col width="13*" align="left" />
210210 <col width="16*" align="right" />
211− <col width="33*" align="left" />
211+ <col width="35*" align="left" />
212212 <tbody>
213213 <tr>
214214 <td>First</td>
test/tables.latex+9−9
@@ -58,7 +58,7 @@ Centered Header\strut
5858Left Aligned\strut
5959\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
6060Right Aligned\strut
61−\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
61+\end{minipage} & \begin{minipage}[b]{0.31\columnwidth}\raggedright
6262Default aligned\strut
6363\end{minipage}\tabularnewline
6464\midrule
@@ -70,7 +70,7 @@ Centered Header\strut
7070Left Aligned\strut
7171\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
7272Right Aligned\strut
73−\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
73+\end{minipage} & \begin{minipage}[b]{0.31\columnwidth}\raggedright
7474Default aligned\strut
7575\end{minipage}\tabularnewline
7676\midrule
@@ -81,7 +81,7 @@ First\strut
8181row\strut
8282\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
838312.0\strut
84−\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
84+\end{minipage} & \begin{minipage}[t]{0.31\columnwidth}\raggedright
8585Example of a row that spans multiple lines.\strut
8686\end{minipage}\tabularnewline
8787\begin{minipage}[t]{0.13\columnwidth}\centering
@@ -90,7 +90,7 @@ Second\strut
9090row\strut
9191\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
92925.0\strut
93−\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
93+\end{minipage} & \begin{minipage}[t]{0.31\columnwidth}\raggedright
9494Here's another one. Note the blank line between rows.\strut
9595\end{minipage}\tabularnewline
9696\bottomrule
@@ -106,7 +106,7 @@ Centered Header\strut
106106Left Aligned\strut
107107\end{minipage} & \begin{minipage}[b]{0.14\columnwidth}\raggedleft
108108Right Aligned\strut
109−\end{minipage} & \begin{minipage}[b]{0.30\columnwidth}\raggedright
109+\end{minipage} & \begin{minipage}[b]{0.31\columnwidth}\raggedright
110110Default aligned\strut
111111\end{minipage}\tabularnewline
112112\midrule
@@ -117,7 +117,7 @@ First\strut
117117row\strut
118118\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
11911912.0\strut
120−\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
120+\end{minipage} & \begin{minipage}[t]{0.31\columnwidth}\raggedright
121121Example of a row that spans multiple lines.\strut
122122\end{minipage}\tabularnewline
123123\begin{minipage}[t]{0.13\columnwidth}\centering
@@ -126,7 +126,7 @@ Second\strut
126126row\strut
127127\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
1281285.0\strut
129−\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
129+\end{minipage} & \begin{minipage}[t]{0.31\columnwidth}\raggedright
130130Here's another one. Note the blank line between rows.\strut
131131\end{minipage}\tabularnewline
132132\bottomrule
@@ -154,7 +154,7 @@ First\strut
154154row\strut
155155\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
15615612.0\strut
157−\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
157+\end{minipage} & \begin{minipage}[t]{0.31\columnwidth}\raggedright
158158Example of a row that spans multiple lines.\strut
159159\end{minipage}\tabularnewline
160160\begin{minipage}[t]{0.13\columnwidth}\centering
@@ -163,7 +163,7 @@ Second\strut
163163row\strut
164164\end{minipage} & \begin{minipage}[t]{0.14\columnwidth}\raggedleft
1651655.0\strut
166−\end{minipage} & \begin{minipage}[t]{0.30\columnwidth}\raggedright
166+\end{minipage} & \begin{minipage}[t]{0.31\columnwidth}\raggedright
167167Here's another one. Note the blank line between rows.\strut
168168\end{minipage}\tabularnewline
169169\bottomrule
test/tables.man+3−3
@@ -138,7 +138,7 @@ Multiline table with caption:
138138Here's the caption. It may span multiple lines.
139139.TS
140140tab(@);
141−cw(10.5n) lw(9.6n) rw(11.4n) lw(23.6n).
141+cw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).
142142T{
143143Centered Header
144144T}@T{
@@ -174,7 +174,7 @@ Multiline table without caption:
174174.PP
175175.TS
176176tab(@);
177−cw(10.5n) lw(9.6n) rw(11.4n) lw(23.6n).
177+cw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).
178178T{
179179Centered Header
180180T}@T{
@@ -244,7 +244,7 @@ Multiline table without column headers:
244244.PP
245245.TS
246246tab(@);
247−cw(10.5n) lw(9.6n) rw(11.4n) lw(23.6n).
247+cw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).
248248T{
249249First
250250T}@T{
test/tables.mediawiki+3−3
@@ -79,7 +79,7 @@ Multiline table with caption:
7979!align="center" width="15%"| Centered Header
8080!width="13%"| Left Aligned
8181!align="right" width="16%"| Right Aligned
82−!width="33%"| Default aligned
82+!width="35%"| Default aligned
8383|-
8484|align="center"| First
8585| row
@@ -98,7 +98,7 @@ Multiline table without caption:
9898!align="center" width="15%"| Centered Header
9999!width="13%"| Left Aligned
100100!align="right" width="16%"| Right Aligned
101−!width="33%"| Default aligned
101+!width="35%"| Default aligned
102102|-
103103|align="center"| First
104104| row
@@ -136,7 +136,7 @@ Multiline table without column headers:
136136|align="center" width="15%"| First
137137|width="13%"| row
138138|align="right" width="16%"| 12.0
139−|width="33%"| Example of a row that spans multiple lines.
139+|width="35%"| Example of a row that spans multiple lines.
140140|-
141141|align="center"| Second
142142| row
test/tables.ms+3−3
@@ -138,7 +138,7 @@ Multiline table with caption:
138138Here’s the caption. It may span multiple lines.
139139.TS
140140delim(@@) tab( );
141−cw(10.5n) lw(9.6n) rw(11.4n) lw(23.6n).
141+cw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).
142142T{
143143Centered Header
144144T} T{
@@ -174,7 +174,7 @@ Multiline table without caption:
174174.PP
175175.TS
176176delim(@@) tab( );
177−cw(10.5n) lw(9.6n) rw(11.4n) lw(23.6n).
177+cw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).
178178T{
179179Centered Header
180180T} T{
@@ -244,7 +244,7 @@ Multiline table without column headers:
244244.PP
245245.TS
246246delim(@@) tab( );
247−cw(10.5n) lw(9.6n) rw(11.4n) lw(23.6n).
247+cw(10.5n) lw(9.6n) rw(11.4n) lw(24.5n).
248248T{
249249First
250250T} T{
test/tables.native+3−3
@@ -53,7 +53,7 @@
5353 ,[Plain [Str "1"]]
5454 ,[Plain [Str "1"]]]]
5555,Para [Str "Multiline",Space,Str "table",Space,Str "with",Space,Str "caption:"]
56−,Table [Str "Here\8217s",Space,Str "the",Space,Str "caption.",SoftBreak,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."] [AlignCenter,AlignLeft,AlignRight,AlignLeft] [0.15,0.1375,0.1625,0.3375]
56+,Table [Str "Here\8217s",Space,Str "the",Space,Str "caption.",SoftBreak,Str "It",Space,Str "may",Space,Str "span",Space,Str "multiple",Space,Str "lines."] [AlignCenter,AlignLeft,AlignRight,AlignLeft] [0.15,0.1375,0.1625,0.35]
5757 [[Plain [Str "Centered",SoftBreak,Str "Header"]]
5858 ,[Plain [Str "Left",SoftBreak,Str "Aligned"]]
5959 ,[Plain [Str "Right",SoftBreak,Str "Aligned"]]
@@ -67,7 +67,7 @@
6767 ,[Plain [Str "5.0"]]
6868 ,[Plain [Str "Here\8217s",Space,Str "another",Space,Str "one.",Space,Str "Note",SoftBreak,Str "the",Space,Str "blank",Space,Str "line",Space,Str "between",Space,Str "rows."]]]]
6969,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "caption:"]
70−,Table [] [AlignCenter,AlignLeft,AlignRight,AlignLeft] [0.15,0.1375,0.1625,0.3375]
70+,Table [] [AlignCenter,AlignLeft,AlignRight,AlignLeft] [0.15,0.1375,0.1625,0.35]
7171 [[Plain [Str "Centered",SoftBreak,Str "Header"]]
7272 ,[Plain [Str "Left",SoftBreak,Str "Aligned"]]
7373 ,[Plain [Str "Right",SoftBreak,Str "Aligned"]]
@@ -99,7 +99,7 @@
9999 ,[Plain [Str "1"]]
100100 ,[Plain [Str "1"]]]]
101101,Para [Str "Multiline",Space,Str "table",Space,Str "without",Space,Str "column",Space,Str "headers:"]
102−,Table [] [AlignCenter,AlignLeft,AlignRight,AlignDefault] [0.15,0.1375,0.1625,0.3375]
102+,Table [] [AlignCenter,AlignLeft,AlignRight,AlignDefault] [0.15,0.1375,0.1625,0.35]
103103 [[]
104104 ,[]
105105 ,[]
test/tables.plain+8−8
@@ -28,33 +28,33 @@ Simple table indented two spaces:
2828
2929Multiline table with caption:
3030
31− -------------------------------------------------------------
31+ --------------------------------------------------------------
3232 Centered Left Right Default aligned
3333 Header Aligned Aligned
34− ----------- ---------- ------------ -------------------------
34+ ----------- ---------- ------------ --------------------------
3535 First row 12.0 Example of a row that
3636 spans multiple lines.
3737
3838 Second row 5.0 Here’s another one. Note
3939 the blank line between
4040 rows.
41− -------------------------------------------------------------
41+ --------------------------------------------------------------
4242
4343 : Here’s the caption. It may span multiple lines.
4444
4545Multiline table without caption:
4646
47− -------------------------------------------------------------
47+ --------------------------------------------------------------
4848 Centered Left Right Default aligned
4949 Header Aligned Aligned
50− ----------- ---------- ------------ -------------------------
50+ ----------- ---------- ------------ --------------------------
5151 First row 12.0 Example of a row that
5252 spans multiple lines.
5353
5454 Second row 5.0 Here’s another one. Note
5555 the blank line between
5656 rows.
57− -------------------------------------------------------------
57+ --------------------------------------------------------------
5858
5959Table without column headers:
6060
@@ -66,11 +66,11 @@ Table without column headers:
6666
6767Multiline table without column headers:
6868
69− ----------- ---------- ------------ -------------------------
69+ ----------- ---------- ------------ --------------------------
7070 First row 12.0 Example of a row that
7171 spans multiple lines.
7272
7373 Second row 5.0 Here’s another one. Note
7474 the blank line between
7575 rows.
76− ----------- ---------- ------------ -------------------------
76+ ----------- ---------- ------------ --------------------------
test/tables.rst+30−30
@@ -42,31 +42,31 @@ Multiline table with caption:
4242
4343.. table:: Here’s the caption. It may span multiple lines.
4444
45− +----------+---------+-----------+-------------------------+
46− | Centered | Left | Right | Default aligned |
47− | Header | Aligned | Aligned | |
48− +==========+=========+===========+=========================+
49− | First | row | 12.0 | Example of a row that |
50− | | | | spans multiple lines. |
51− +----------+---------+-----------+-------------------------+
52− | Second | row | 5.0 | Here’s another one. |
53− | | | | Note the blank line |
54− | | | | between rows. |
55− +----------+---------+-----------+-------------------------+
45+ +----------+---------+-----------+--------------------------+
46+ | Centered | Left | Right | Default aligned |
47+ | Header | Aligned | Aligned | |
48+ +==========+=========+===========+==========================+
49+ | First | row | 12.0 | Example of a row that |
50+ | | | | spans multiple lines. |
51+ +----------+---------+-----------+--------------------------+
52+ | Second | row | 5.0 | Here’s another one. Note |
53+ | | | | the blank line between |
54+ | | | | rows. |
55+ +----------+---------+-----------+--------------------------+
5656
5757Multiline table without caption:
5858
59−+----------+---------+-----------+-------------------------+
60−| Centered | Left | Right | Default aligned |
61−| Header | Aligned | Aligned | |
62−+==========+=========+===========+=========================+
63−| First | row | 12.0 | Example of a row that |
64−| | | | spans multiple lines. |
65−+----------+---------+-----------+-------------------------+
66−| Second | row | 5.0 | Here’s another one. |
67−| | | | Note the blank line |
68−| | | | between rows. |
69−+----------+---------+-----------+-------------------------+
59++----------+---------+-----------+--------------------------+
60+| Centered | Left | Right | Default aligned |
61+| Header | Aligned | Aligned | |
62++==========+=========+===========+==========================+
63+| First | row | 12.0 | Example of a row that |
64+| | | | spans multiple lines. |
65++----------+---------+-----------+--------------------------+
66+| Second | row | 5.0 | Here’s another one. Note |
67+| | | | the blank line between |
68+| | | | rows. |
69++----------+---------+-----------+--------------------------+
7070
7171Table without column headers:
7272
@@ -80,11 +80,11 @@ Table without column headers:
8080
8181Multiline table without column headers:
8282
83−+----------+---------+-----------+-------------------------+
84−| First | row | 12.0 | Example of a row that |
85−| | | | spans multiple lines. |
86−+----------+---------+-----------+-------------------------+
87−| Second | row | 5.0 | Here’s another one. |
88−| | | | Note the blank line |
89−| | | | between rows. |
90−+----------+---------+-----------+-------------------------+
83++----------+---------+-----------+--------------------------+
84+| First | row | 12.0 | Example of a row that |
85+| | | | spans multiple lines. |
86++----------+---------+-----------+--------------------------+
87+| Second | row | 5.0 | Here’s another one. Note |
88+| | | | the blank line between |
89+| | | | rows. |
90++----------+---------+-----------+--------------------------+
test/tables.rtf+8−8
@@ -187,7 +187,7 @@
187187{\pard \ql \f0 \sa180 \li0 \fi0 Multiline table with caption:\par}
188188{
189189\trowd \trgaph120
190−\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6804
190+\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6912
191191\trkeep\intbl
192192{
193193{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Centered Header\par}
@@ -202,7 +202,7 @@
202202\intbl\row}
203203{
204204\trowd \trgaph120
205−\cellx1296\cellx2484\cellx3888\cellx6804
205+\cellx1296\cellx2484\cellx3888\cellx6912
206206\trkeep\intbl
207207{
208208{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 First\par}
@@ -217,7 +217,7 @@
217217\intbl\row}
218218{
219219\trowd \trgaph120
220−\cellx1296\cellx2484\cellx3888\cellx6804
220+\cellx1296\cellx2484\cellx3888\cellx6912
221221\trkeep\intbl
222222{
223223{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Second\par}
@@ -234,7 +234,7 @@
234234{\pard \ql \f0 \sa180 \li0 \fi0 Multiline table without caption:\par}
235235{
236236\trowd \trgaph120
237−\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6804
237+\clbrdrb\brdrs\cellx1296\clbrdrb\brdrs\cellx2484\clbrdrb\brdrs\cellx3888\clbrdrb\brdrs\cellx6912
238238\trkeep\intbl
239239{
240240{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Centered Header\par}
@@ -249,7 +249,7 @@
249249\intbl\row}
250250{
251251\trowd \trgaph120
252−\cellx1296\cellx2484\cellx3888\cellx6804
252+\cellx1296\cellx2484\cellx3888\cellx6912
253253\trkeep\intbl
254254{
255255{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 First\par}
@@ -264,7 +264,7 @@
264264\intbl\row}
265265{
266266\trowd \trgaph120
267−\cellx1296\cellx2484\cellx3888\cellx6804
267+\cellx1296\cellx2484\cellx3888\cellx6912
268268\trkeep\intbl
269269{
270270{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Second\par}
@@ -328,7 +328,7 @@
328328{\pard \ql \f0 \sa180 \li0 \fi0 Multiline table without column headers:\par}
329329{
330330\trowd \trgaph120
331−\cellx1296\cellx2484\cellx3888\cellx6804
331+\cellx1296\cellx2484\cellx3888\cellx6912
332332\trkeep\intbl
333333{
334334{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 First\par}
@@ -343,7 +343,7 @@
343343\intbl\row}
344344{
345345\trowd \trgaph120
346−\cellx1296\cellx2484\cellx3888\cellx6804
346+\cellx1296\cellx2484\cellx3888\cellx6912
347347\trkeep\intbl
348348{
349349{{\pard\intbl \qc \f0 \sa0 \li0 \fi0 Second\par}
test/tables.texinfo+3−3
@@ -83,7 +83,7 @@ Right
8383Multiline table with caption:
8484
8585@float
86−@multitable @columnfractions 0.15 0.14 0.16 0.34
86+@multitable @columnfractions 0.15 0.14 0.16 0.35
8787@headitem
8888Centered Header
8989 @tab Left Aligned
@@ -104,7 +104,7 @@ Second
104104@end float
105105Multiline table without caption:
106106
107−@multitable @columnfractions 0.15 0.14 0.16 0.34
107+@multitable @columnfractions 0.15 0.14 0.16 0.35
108108@headitem
109109Centered Header
110110 @tab Left Aligned
@@ -144,7 +144,7 @@ Table without column headers:
144144
145145Multiline table without column headers:
146146
147−@multitable @columnfractions 0.15 0.14 0.16 0.34
147+@multitable @columnfractions 0.15 0.14 0.16 0.35
148148@item
149149First
150150 @tab row
test/tables.textile+3−3
@@ -80,7 +80,7 @@ Multiline table with caption:
8080<col width="15%" />
8181<col width="13%" />
8282<col width="16%" />
83−<col width="33%" />
83+<col width="35%" />
8484<thead>
8585<tr class="header">
8686<th align="center">Centered Header</th>
@@ -111,7 +111,7 @@ Multiline table without caption:
111111<col width="15%" />
112112<col width="13%" />
113113<col width="16%" />
114−<col width="33%" />
114+<col width="35%" />
115115<thead>
116116<tr class="header">
117117<th align="center">Centered Header</th>
@@ -148,7 +148,7 @@ Multiline table without column headers:
148148<col width="15%" />
149149<col width="13%" />
150150<col width="16%" />
151−<col width="33%" />
151+<col width="35%" />
152152<tbody>
153153<tr class="odd">
154154<td align="center">First</td>