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

Method text

src/docx/text/paragraph.py:150–163  ·  view source on GitHub ↗

The textual content of this paragraph. The text includes the visible-text portion of any hyperlinks in the paragraph. Tabs and line breaks in the XML are mapped to ``\\t`` and ``\\n`` characters respectively. Assigning text to this property causes all existing parag

(self)

Source from the content-addressed store, hash-verified

148
149 @property
150 def text(self) -> str:
151 """The textual content of this paragraph.
152
153 The text includes the visible-text portion of any hyperlinks in the paragraph.
154 Tabs and line breaks in the XML are mapped to ``\\t`` and ``\\n`` characters
155 respectively.
156
157 Assigning text to this property causes all existing paragraph content to be
158 replaced with a single run containing the assigned text. A ``\\t`` character in
159 the text is mapped to a ``<w:tab/>`` element and each ``\\n`` or ``\\r``
160 character is mapped to a line break. Paragraph-level formatting, such as style,
161 is preserved. All run-level formatting, such as bold or italic, is removed.
162 """
163 return self._p.text
164
165 @text.setter
166 def text(self, text: str | None):

Callers

nothing calls this directly

Calls 2

clearMethod · 0.95
add_runMethod · 0.95

Tested by

no test coverage detected