Repository navigation
fix(docx): name in the report what a list's items lose - #861
Merged
Merged
Conversation
A list's note now names its alignment (items written flush left), its lineSpacing where the layout's items are not its own and one wraps, its continuationIndent where an item of a list the page sets it in wraps, and how many items stand at a stated column, a space past their marker or two spaces a level in rather than where the page sets them. With no layout the section's note names the space between lines. The DOCX bytes do not change.
…ame a marker drawn alone The writers return how many items stand where the page sets them, each branch assigning it, so an item a path forgets counts as off its column. A hangingIndent list's blank item, which the page draws as its marker alone and the export does not write, is named, and is no longer taken for an item run onto the next page. A continuationIndent whose lines cannot be read is named as unmeasured. The README and the recipe's lineSpacing paragraph say what the list note names.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Why
DocxExportReportpromises to name every loss. For a list it named none, while the Word file lost these:Alignment. A centred or right-aligned list is written flush left.
lineSpacing. The gap between a wrapped item's lines is written only by the layout's own lines for that item. Where the layout's items are not the list's own — an item run onto the next page is laid out as two, a list composed in a table cell has no fragments of its own — no item gets it.
continuationIndent. The page sets it before every wrapped line of a list whose markers are not drawn before them: a hidden marker, or a tree of items flattened into its labels. The file never writes it.
The marker column and markerGap. An item at the stated column — 9pt in, 6pt more a level — stands off the page's column. So does a
hangingIndentitem a space past its marker or two spaces a level in. Every item stands off its column in:A list of paragraphs that nests only markerless rich items is the exception: its items stand where the page sets them.
A row of a marker alone. A
hangingIndentlist draws a blank item whose marker is visible as a row of its own; the export writes no paragraph for a blank item.DocxNodeFieldLedgerTestlisted the five list fields as gaps, anditemsas written.What changed
writeListreports what its items lose throughlistLost, as oneListNodenote: "written as a Word list", "written as a paragraph per item" or, for a list of blank items, "writes no paragraph", then:hangingIndent— where an item wraps;writeListItemsandwriteNestedItemreturn how many items stand where the page sets them. The note names the rest.atItsColumnbefore the item is counted, so a new branch that says nothing does not compile, and an item a path forgets counts as off its column.writeRichListLineset where the page does — tabbed to the layout's column, at the layout's own place for a nested item, or at the edge with no marker — which it now returns;hangingIndent, and with it only a top-level item with no marker (standsAsItsLetters).measured geometrynote now says "line heights, the space between lines and auto column widths are the editor's". That also covers a paragraph'slineSpacing, which without a layout is put between no lines.align,lineSpacing,continuationIndent,hangingIndentandmarkerGapmove from a gap toREPORTED.itemsmove fromWRITTENtoREPORTEDfor a blank item drawn as a marker alone.render-docx/README.mdand the CHANGELOG say what the note names. The README no longer says every hanging-indent list loses itsmarkerGap.Verification
./mvnw -B -ntp install -pl :graph-compose-render-docx→ BUILD SUCCESS: 1071 tests, 0 failures, 1 skipped (the property-gated fidelity probe).DocxListReportTestis new, 8 tests.hangingIndentlist (3 of 3);markerGap(0), with a text marker and with a drawn disc;hangingIndent;hangingIndentlist;hangingIndentlist at the page's column, with a text marker and with a disc tabbed to it;hangingIndent;hangingIndent, or with no marker.hangingIndentguard, the tree of items;hangingIndent;hangingIndent, a visible marker);DocxFidelityCorpusTest -Dgraphcompose.docxFidelity=export, SHA-256 per file, 0 of 62 differ.SlateOrange's certifications, a bullet list composed in a table cell, written at the stated column.-pl :graph-compose-core -Dtest='com.demcha.documentation.**'→ 166 tests, 0 failures;DocxPageZoneTest,DocxTransparentWrapperTest,TimelineRailAcrossBackendsTestandRtlAcrossBackendsTest→ 50 tests, 0 failures.Known limits
Lane: render-docx backend (report only, no change to what is written) plus tests and docs.