c266734448
Previously we used our own homespun formatting. But this produces over-long lines that aren't ideal for diffs in tests. Easier to use something off-the-shelf and standard. Closes #7580. Performance is slower by about a factor of 10, but this isn't really a problem because native isn't suitable as a serialization format. (For serialization you should use json, because the reader is so much faster than native.)
3.1 KiB
3.1 KiB
% pandoc -f html -t native
<table>
<caption>Demonstration of simple table syntax.</caption>
<thead>
<tr class="header">
<th align="right">Right</th>
<th align="left">Left</th>
<th align="center">Center</th>
<th>Default</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td align="right">12</td>
<td align="left">12</td>
<td align="center">12</td>
<td>12</td>
</tr>
</tbody>
</table>
^D
[ Table
( "", [], [] )
( Caption Nothing
[ Plain
[ Str "Demonstration"
, Space
, Str "of"
, Space
, Str "simple"
, Space
, Str "table"
, Space
, Str "syntax."
]
]
)
[
( AlignRight, ColWidthDefault )
,
( AlignLeft, ColWidthDefault )
,
( AlignCenter, ColWidthDefault )
,
( AlignDefault, ColWidthDefault )
]
( TableHead
( "", [], [] )
[ Row
( "", [ "header" ], [] )
[ Cell
( "", [], [] ) AlignRight
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "Right" ] ]
, Cell
( "", [], [] ) AlignLeft
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "Left" ] ]
, Cell
( "", [], [] ) AlignCenter
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "Center" ] ]
, Cell
( "", [], [] ) AlignDefault
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "Default" ] ]
]
]
)
[ TableBody
( "", [], [] )
( RowHeadColumns 0 ) []
[ Row
( "", [ "odd" ], [] )
[ Cell
( "", [], [] ) AlignRight
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
, Cell
( "", [], [] ) AlignLeft
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
, Cell
( "", [], [] ) AlignCenter
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
, Cell
( "", [], [] ) AlignDefault
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
]
]
]
( TableFoot ( "", [], [] ) [] )
]
% pandoc -f html -t native
<table>
<tr class="odd">
<td style="text-align: right;">12</td>
<td style="text-align:left;">12</td>
<td style="text-align: center">12</td>
<td style="text-align: right;">12</td>
</tr>
</table>
^D
[ Table
( "", [], [] )
( Caption Nothing [] )
[
( AlignRight, ColWidthDefault )
,
( AlignLeft, ColWidthDefault )
,
( AlignCenter, ColWidthDefault )
,
( AlignRight, ColWidthDefault )
]
( TableHead ( "", [], [] ) [] )
[ TableBody
( "", [], [] )
( RowHeadColumns 0 ) []
[ Row
( "", [ "odd" ], [] )
[ Cell
( "", [], [] ) AlignRight
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
, Cell
( "", [], [] ) AlignLeft
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
, Cell
( "", [], [] ) AlignCenter
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
, Cell
( "", [], [] ) AlignRight
( RowSpan 1 )
( ColSpan 1 )
[ Plain [ Str "12" ] ]
]
]
]
( TableFoot ( "", [], [] ) [] )
]