Repository navigation
fix(docx): name in the report a paragraph or list item the page reads as markdown - #864
Merged
Merged
Conversation
… as markdown A session reads markdown unless told not to: the page sets the text a paragraph's or a plain list item's emphasis marks style and drops the marks, while the DOCX export writes the text as authored, marks and all. The paragraph's, the zone's and the list's notes now name it, read from the laid-out lines, which hold fewer marks than the text where the page read it, and say it is not measured where the lines are not read. The written bytes do not change.
…ame unread lines only where the parser drops a mark A marker typed before a list item is taken off by both the page and the file, so it is no markdown mark lost: items are counted as the page lays them out, against their own lines without a marker laid out apart. Where no lines are read, the note says markdown is not measured only where the page's parser would drop a mark, so a cell holding node_js is not named. Lines holding no text are not counted, and the docs say the file does not yet write the text as the page sets it.
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
A session reads markdown unless it is told not to:
GraphCompose.document()defaults tomarkdown(true).*,_,`) as markdown, through flexmark (MarkDownParser):**bold**with its asterisks and none of the bold. The report named none of it, and the markdown flag never reaches a semantic backend.TimelineMinimal's open-source project line ends in*(Open source)*: the page sets it in italic, and Word showed the asterisks.What changed
markdownLostnames a paragraph the page read as markdown. It is added to the paragraph's note on every body path (paragraphLost: the body, a text box, a side of a pair, a badge) and to a zone paragraph's, on itspage zonenote (zoneParagraphLost). The phrase: "its markdown marks are written as letters, where the page sets the text they mark and drops them".itemsMarkdownLostnames a list's items, on the list's note: "its items' markdown marks are written as letters, …".marksDropped, shared by both).holdsAMarkdownTrigger,readsAsMarkdown): plain text, no runs, holding*,_or`. Only then are the laid-out lines read.*_`\#[]()>~) than the text, as the page lays it out, where the page read it. Both sides count the same characters, so one the page keeps counts on both.ListMarker.normalizeItemText), as both the page and the file take it off;itemLines), without a marker laid out on its own.parserDropsAMarkrunsMarkDownParseron the text). That happens with no layout, or composed in a table cell: a paragraph there is matched to its lines by its text, and a list is not matched at all. The phrase then ends "— whether the page reads them is not measured". A cell holdingnode_jsis not named, since the parser keeps that underscore.textmoves fromWRITTENtoREPORTED;nestedItemsmoves fromWRITTENtoREPORTED;items, alreadyREPORTED, names it too.render-docx/README.md;Verification
./mvnw -B -ntp install -pl :graph-compose-render-docx→ BUILD SUCCESS: 1096 tests, 0 failures, 1 skipped (the property-gated fidelity probe).DocxMarkdownReportTestis new, with 5 tests.DocxFidelityCorpusTest -Dgraphcompose.docxFidelity=export, SHA-256 per file, 0 of 62 differ.TimelineMinimal's project line: 951 notes, from 950.-pl :graph-compose-core -Dtest='com.demcha.documentation.**'→ 166 tests, 0 failures;DocxPageZoneTest,DocxTransparentWrapperTest,TimelineRailAcrossBackendsTestandRtlAcrossBackendsTest→ 50 tests, 0 failures.Known limits
ListMarker.custom("*")or"(a)"adds marks to the lines.1.line read as a list item, a---rule and an entity like&hold none of the counted characters.Lane: render-docx backend (report only, no change to what is written) plus tests and docs.