Repository navigation
fix(docx): set a paragraph's mark in what its text ends in, so Enter continues it - #849
Merged
Merged
Conversation
…and typing at the end continue it
…continues, and run chosen scenarios
…ext at a readable size only
… in, and re-render the Word export preview
…-document check and -Scenario
… in their text's style
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
Word continues a paragraph from its mark, the character that closes it:
styleTheMarkskipped every paragraph written at an exact line height, which is almost all of them, because the mark does not grow such a line. It wrote only size and face elsewhere. So the mark stayed in the document's own formatting.The editing protocol (#847) in Word 16.0.20430 measured the effect on the corpus's
2.5-devexport:NavySidebar, 14pt after 11pt inClassicInvoice.What changed
styleTheMarkstyles a scratch run withapplyStyleand moves its properties onto the paragraph's mark through the typedCTParaRPrsetters, which keep the schema's order. The mark gets face, size, colour, weight, slant, strike, underline and tracking, asapplyStylewrites them for the text's last run, so text restating Normal leaves its mark silent. It does not get what is written besideapplyStyle: a chip's shading, a run's direction, the spacing that fits a line to the page. Exact lines are no longer skipped.ListMarkerGeometry,ParagraphWrapping). A measured top level also states the list's face, size and colour on the level.edit-protocol-corpus.ps1:-Scenarioruns chosen scenarios. Names given comma-separated are split, and an unknown name is refused.CONTRIBUTING.mddescribes both.assets/readme/examples/word-export-companion.docxis re-rendered, since its paragraph marks changed.Verification
Editing protocol (Word 16.0.20430, 62 documents,
-Scenario insert-a-paragraph,add-a-page; both columns measured with this branch's script):2.5-devSerifHeadlinefailing, 7pt → 8pt. That was the protocol: it took the last letter by counting characters, and the drawing anchors in that paragraph threw the count off. Taking it by position settles it.Word corpus.
scripts/docx-visual/word-fidelity.ps1 -Update→ BUILD SUCCESS, baselines unchanged: no line moved.LibreOffice. 20 lines move down by up to 0.2pt and none across, on Windows and on Linux.
ConsultingInvoice's label column (−0.63 → −0.53pt), and 5 further,SerifHeadline's and two ofNavySidebar's dates. Two runs gave the same figures.Both baselines are committed. The chip change moved no corpus line, in either editor.
Tests:
DocxParagraphMarkTest:1E5AA0;Sabotage. Each change fails a test:
render-docx. 897 tests green.
Full reactor gate.
./mvnw -B -ntp clean verify -pl :graph-compose-core,:graph-compose-render-pdf,:graph-compose-render-docx,:graph-compose-render-pptx,:graph-compose-templates,:graph-compose-testing,:graph-compose-qa,:graph-compose-coverage -am→ BUILD SUCCESS (qa 1820 tests).Examples.
CommittedAssetDriftTest→ 3 / 3 green after re-rendering the DOCX preview. The example's PDF is unchanged.Notes
Lane: shared-engine (render-docx), with the test script in
scripts/docx-visual.