diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e0fed15d..a82f2b6df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/unstructured/__version__.py b/unstructured/__version__.py index 4f1e2327c..bd4e32c66 100644 --- a/unstructured/__version__.py +++ b/unstructured/__version__.py @@ -1 +1 @@ -__version__ = "0.7.7-dev2" # pragma: no cover +__version__ = "0.7.7" # pragma: no cover diff --git a/unstructured/partition/docx.py b/unstructured/partition/docx.py index 9d73e4675..f5f412e78 100644 --- a/unstructured/partition/docx.py +++ b/unstructured/partition/docx.py @@ -220,9 +220,10 @@ def _element_contains_pagebreak(element) -> bool: ["w:br", 'type="page"'], # "Hard" page break inserted by user ["lastRenderedPageBreak"], # "Soft" page break inserted by renderer ] - for indicators in page_break_indicators: - if all(indicator in element.xml for indicator in indicators): - return True + if hasattr(element, "xml"): + for indicators in page_break_indicators: + if all(indicator in element.xml for indicator in indicators): + return True return False