aboutsummaryrefslogtreecommitdiff
path: root/test/markdown-reader-more.native
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-07-30 17:56:44 +0200
committerGitHub <[email protected]>2022-07-30 08:56:44 -0700
commitc015c35a8a7026dd7ee3207053319e886fa637c2 (patch)
tree0f24979fd42d380650c949e2b33bda76d8cbb8df /test/markdown-reader-more.native
parentde5620b04df540d11efdf96fb142b63b5ec4d3c5 (diff)
Support rowspans and colspans in grid tables (#8202)
* Add tests for zero-width and fullwidth chars in grid tables * T.P.Parsing: simplify `gridTableWith'`, `gridTableWith` [API Change] The functions `gridTableWith` and `gridTableWith'` no longer takes a boolean argument that toggles whether a table head should be parsed: both, tables with heads and without heads, are always accepted now. * Support colspans, rowspans, and multirow headers in grid tables. Grid tables in Markdown, reStructuredText, and Org can now contain cells spanning over multiple columns and/or multiple rows; table headers containing multiple rows are supported as well. Note: the markdown writer does not yet support these more complex grid table features.
Diffstat (limited to 'test/markdown-reader-more.native')
-rw-r--r--test/markdown-reader-more.native239
1 files changed, 236 insertions, 3 deletions
diff --git a/test/markdown-reader-more.native b/test/markdown-reader-more.native
index 82b3577be..f200d0705 100644
--- a/test/markdown-reader-more.native
+++ b/test/markdown-reader-more.native
@@ -1022,7 +1022,7 @@ Pandoc
1
( "col-1" , [] , [] )
[ Str "col" , Space , Str "1" ]
- , Plain [ Str "col" , Space , Str "1" ]
+ , Para [ Str "col" , Space , Str "1" ]
]
, Cell
( "" , [] , [] )
@@ -1033,7 +1033,7 @@ Pandoc
1
( "col-2" , [] , [] )
[ Str "col" , Space , Str "2" ]
- , Plain [ Str "col" , Space , Str "2" ]
+ , Para [ Str "col" , Space , Str "2" ]
]
, Cell
( "" , [] , [] )
@@ -1044,7 +1044,7 @@ Pandoc
1
( "col-3" , [] , [] )
[ Str "col" , Space , Str "3" ]
- , Plain [ Str "col" , Space , Str "3" ]
+ , Para [ Str "col" , Space , Str "3" ]
]
]
, Row
@@ -1261,6 +1261,239 @@ Pandoc
]
]
(TableFoot ( "" , [] , [] ) [])
+ , Para
+ [ Str "Table"
+ , Space
+ , Str "with"
+ , Space
+ , Str "cells"
+ , Space
+ , Str "spanning"
+ , Space
+ , Str "multiple"
+ , Space
+ , Str "rows"
+ , Space
+ , Str "or"
+ , Space
+ , Str "columns:"
+ ]
+ , Table
+ ( "" , [] , [] )
+ (Caption Nothing [])
+ [ ( AlignDefault , ColWidth 0.19444444444444445 )
+ , ( AlignDefault , ColWidth 0.1111111111111111 )
+ , ( AlignDefault , ColWidth 0.1527777777777778 )
+ ]
+ (TableHead
+ ( "" , [] , [] )
+ [ Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 2)
+ [ Plain [ Str "Property" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "Earth" ] ]
+ ]
+ ])
+ [ TableBody
+ ( "" , [] , [] )
+ (RowHeadColumns 0)
+ []
+ [ Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 3)
+ (ColSpan 1)
+ [ Plain
+ [ Str "Temperature"
+ , SoftBreak
+ , Str "1961-1990"
+ ]
+ ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "min" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "-89.2" , Space , Str "\176C" ] ]
+ ]
+ , Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "mean" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "14" , Space , Str "\176C" ] ]
+ ]
+ , Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "min" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "56.7" , Space , Str "\176C" ] ]
+ ]
+ ]
+ ]
+ (TableFoot ( "" , [] , [] ) [])
+ , Para
+ [ Str "Table"
+ , Space
+ , Str "with"
+ , Space
+ , Str "complex"
+ , Space
+ , Str "header:"
+ ]
+ , Table
+ ( "" , [] , [] )
+ (Caption Nothing [])
+ [ ( AlignDefault , ColWidth 0.3055555555555556 )
+ , ( AlignDefault , ColWidth 0.1111111111111111 )
+ , ( AlignDefault , ColWidth 0.1111111111111111 )
+ , ( AlignDefault , ColWidth 0.1111111111111111 )
+ ]
+ (TableHead
+ ( "" , [] , [] )
+ [ Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 2)
+ (ColSpan 1)
+ [ Plain [ Str "Location" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 3)
+ [ Plain
+ [ Str "Temperature"
+ , Space
+ , Str "1961-1990"
+ , SoftBreak
+ , Str "in"
+ , Space
+ , Str "degree"
+ , Space
+ , Str "Celsius"
+ ]
+ ]
+ ]
+ , Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "min" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "mean" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "max" ] ]
+ ]
+ ])
+ [ TableBody
+ ( "" , [] , [] )
+ (RowHeadColumns 0)
+ []
+ [ Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "Antarctica" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "-89.2" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "N/A" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "19.8" ] ]
+ ]
+ , Row
+ ( "" , [] , [] )
+ [ Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "Earth" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "-89.2" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "14" ] ]
+ , Cell
+ ( "" , [] , [] )
+ AlignDefault
+ (RowSpan 1)
+ (ColSpan 1)
+ [ Plain [ Str "56.7" ] ]
+ ]
+ ]
+ ]
+ (TableFoot ( "" , [] , [] ) [])
, Header
2
( "entities-in-links-and-titles" , [] , [] )