()
| 67 | accum = TextAccumulator() |
| 68 | |
| 69 | def iter_items() -> Iterator[str | CT_Drawing | CT_LastRenderedPageBreak]: |
| 70 | for e in self.xpath( |
| 71 | "w:br" |
| 72 | " | w:cr" |
| 73 | " | w:drawing" |
| 74 | " | w:lastRenderedPageBreak" |
| 75 | " | w:noBreakHyphen" |
| 76 | " | w:ptab" |
| 77 | " | w:t" |
| 78 | " | w:tab" |
| 79 | ): |
| 80 | if isinstance(e, (CT_Drawing, CT_LastRenderedPageBreak)): |
| 81 | yield from accum.pop() |
| 82 | yield e |
| 83 | else: |
| 84 | accum.push(str(e)) |
| 85 | |
| 86 | # -- don't forget the "tail" string -- |
| 87 | yield from accum.pop() |
| 88 | |
| 89 | return list(iter_items()) |
| 90 |