Conversation
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.
RenderedPageBreak.preceding_paragraph_fragmentandfollowing_paragraph_fragmentcan returnNonewhen the paragraph still contains a hyperlink on that side of the break. For example, a hyperlink followed by a run that starts with a rendered page break loses the hyperlink during page-by-page text extraction.The boundary checks currently consider only direct
w:rchildren. Includew:hyperlinkwhen selecting the first/last paragraph content element, matchingCT_P.inner_content_elements. Fragment construction itself already preserves hyperlinks.Four regression cases cover links before and after the break, with and without non-content siblings. They check the extracted text, hyperlink anchor, and that the original paragraph XML is unchanged. All four fail on the unmodified source and pass with this fix.
Validation on Windows / Python 3.12.12:
pytest -q: 1,613 passed.behave --format progress --stop --tags=-wip: 67 features / 650 scenarios passed.ruff check .and formatting checks for both changed files passed.Local test setup uses pytest 8.4.2 and pyparsing 3.2.5, and LF fixture/template files. Dependency and line-ending adjustments are not included in this change. The declared lxml type stubs are installed for the type comparison.
AI assistance was used to investigate, implement, test, and review this change.