fix: check for xml attribute when identifying pagebreaks (#778)

This commit is contained in:
Matt Robinson 2023-06-20 12:44:00 -04:00 committed by GitHub
parent db4c5dfdf7
commit feaf1cb4df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 5 deletions

View File

@ -1,4 +1,4 @@
## 0.7.7-dev2
## 0.7.7
### Enhancements
@ -12,6 +12,8 @@
### Fixes
* Check for the `xml` attribute on `element` before looking for pagebreaks in `partition_docx`.
## 0.7.6
### Enhancements

View File

@ -1 +1 @@
__version__ = "0.7.7-dev2" # pragma: no cover
__version__ = "0.7.7" # pragma: no cover

View File

@ -220,6 +220,7 @@ def _element_contains_pagebreak(element) -> bool:
["w:br", 'type="page"'], # "Hard" page break inserted by user
["lastRenderedPageBreak"], # "Soft" page break inserted by renderer
]
if hasattr(element, "xml"):
for indicators in page_break_indicators:
if all(indicator in element.xml for indicator in indicators):
return True