Generate the runs and hyperlinks in this paragraph, in the order they appear. The content in a paragraph consists of both runs and hyperlinks. This method allows accessing each of those separately, in document order, for when the precise position of the hyperlink within the
(self)
| 92 | return paragraph |
| 93 | |
| 94 | def iter_inner_content(self) -> Iterator[Run | Hyperlink]: |
| 95 | """Generate the runs and hyperlinks in this paragraph, in the order they appear. |
| 96 | |
| 97 | The content in a paragraph consists of both runs and hyperlinks. This method |
| 98 | allows accessing each of those separately, in document order, for when the |
| 99 | precise position of the hyperlink within the paragraph text is important. Note |
| 100 | that a hyperlink itself contains runs. |
| 101 | """ |
| 102 | for r_or_hlink in self._p.inner_content_elements: |
| 103 | yield ( |
| 104 | Run(r_or_hlink, self) |
| 105 | if isinstance(r_or_hlink, CT_R) |
| 106 | else Hyperlink(r_or_hlink, self) |
| 107 | ) |
| 108 | |
| 109 | @property |
| 110 | def paragraph_format(self): |