diff options
| author | Emily Bourke <undergroundquizscene@protonmail.com> | 2020-06-18 09:53:32 +0100 |
|---|---|---|
| committer | Albert Krewinkel <albert@zeitkraut.de> | 2021-05-28 20:15:23 +0200 |
| commit | 56b211120c62a01f8aba1c4512acfe4677d8c7d0 (patch) | |
| tree | 9cc7f09243f80abbdc67957f66381bbf03d0d79f /test/docx/sdt_elements.native | |
| parent | 44484d0dee1bd095240b9faf26f8d1dad8e560ea (diff) | |
Docx reader: Support new table features.
* Column spans
* Row spans
- The spec says that if the `val` attribute is ommitted, its value
should be assumed to be `continue`, and that its values are
restricted to {`restart`, `continue`}. If the value has any other
value, I think it seems reasonable to default it to `continue`. It
might cause problems if the spec is extended in the future by adding
a third possible value, in which case this would probably give
incorrect behaviour, and wouldn't error.
* Allow multiple header rows
* Include table description in simple caption
- The table description element is like alt text for a table (along
with the table caption element). It seems like we should include
this somewhere, but I’m not 100% sure how – I’m pairing it with the
simple caption for the moment. (Should it maybe go in the block
caption instead?)
* Detect table captions
- Check for caption paragraph style /and/ either the simple or
complex table field. This means the caption detection fails for
captions which don’t contain a field, as in an example doc I added
as a test. However, I think it’s better to be too conservative: a
missed table caption will still show up as a paragraph next to the
table, whereas if I incorrectly classify something else as a table
caption it could cause havoc by pairing it up with a table it’s
not at all related to, or dropping it entirely.
* Update tests and add new ones
Partially fixes: #6316
Diffstat (limited to 'test/docx/sdt_elements.native')
| -rw-r--r-- | test/docx/sdt_elements.native | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/test/docx/sdt_elements.native b/test/docx/sdt_elements.native index a072c0d39..d2aa00994 100644 --- a/test/docx/sdt_elements.native +++ b/test/docx/sdt_elements.native @@ -4,17 +4,16 @@ ,(AlignDefault,ColWidth 0.22069570301081556) ,(AlignDefault,ColWidth 0.5586085939783689)] (TableHead ("",[],[]) - []) - [(TableBody ("",[],[]) (RowHeadColumns 0) - [] - [Row ("",[],[]) + [Row ("",[],[]) [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Strong [Str "col1Header"]]] ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Strong [Str "col2Header"]]] ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) - [Plain [Strong [Str "col3Header"]]]] - ,Row ("",[],[]) + [Plain [Strong [Str "col3Header"]]]]]) + [(TableBody ("",[],[]) (RowHeadColumns 0) + [] + [Row ("",[],[]) [Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "col1",Space,Str "content"]] ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) @@ -22,4 +21,4 @@ ,Cell ("",[],[]) AlignDefault (RowSpan 1) (ColSpan 1) [Plain [Str "col3",Space,Str "content"]]]])] (TableFoot ("",[],[]) - [])]
\ No newline at end of file + [])] |
