MCPcopy Index your code
hub / github.com/python-openxml/python-docx / iter_inner_content

Method iter_inner_content

src/docx/text/paragraph.py:94–107  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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):

Calls 2

RunClass · 0.90
HyperlinkClass · 0.90