asciidoc writer: Add more table features #11267
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the following table features:
In addition to handling row spans in headers and footer as described in #7326 (comment) I also had to handle row spans over empty rows. You can't really write an empty row in asciidoc but a row span that would go into an empty row still has to be handled. Otherwise the row span wouldn't add up.
I made those row spans basically consume empty rows. Whenever there are row spans that would go over an empty row, that empty row is removed and the row span is decremented. This corrects the row span count in the asciidoc output and handles empty rows.
Any empty rows that remain get filled up with empty columns.
T.P.Writers.Shared: Add functions
allRowsEmptyandtableBodiesToRowsfrom the RST writer for reuse in the asciidoc writer.I got hlint warnings about
NonEmptyandunzip: CurrentlyNonEmptyexports a polymorphicunzipfunction but that will become monomorphic in base-4.22 (https://hackage.haskell.org/package/base-4.21.0.0/docs/Data-List-NonEmpty.html#v:unzip). To avoid any hassles in the future I restricted theNonEmptyimports so that the Preludeunzipfunction is used.Fixes: #7326
Fixes: #8199