Return paragraph newly added to the end of the content in this container. The paragraph has `text` in a single run if present, and is given paragraph style `style`. When `style` is |None| or ommitted, the "CommentText" paragraph style is applied, which is the default style f
(self, text: str = "", style: str | ParagraphStyle | None = None)
| 99 | self._comment_elm = comment_elm |
| 100 | |
| 101 | def add_paragraph(self, text: str = "", style: str | ParagraphStyle | None = None) -> Paragraph: |
| 102 | """Return paragraph newly added to the end of the content in this container. |
| 103 | |
| 104 | The paragraph has `text` in a single run if present, and is given paragraph style `style`. |
| 105 | When `style` is |None| or ommitted, the "CommentText" paragraph style is applied, which is |
| 106 | the default style for comments. |
| 107 | """ |
| 108 | paragraph = super().add_paragraph(text, style) |
| 109 | |
| 110 | # -- have to assign style directly to element because `paragraph.style` raises when |
| 111 | # -- a style is not present in the styles part |
| 112 | if style is None: |
| 113 | paragraph._p.style = "CommentText" # pyright: ignore[reportPrivateUsage] |
| 114 | |
| 115 | return paragraph |
| 116 | |
| 117 | @property |
| 118 | def author(self) -> str: |