(self, style_args: StyleArg)
| 89 | self.text = re.sub(r"(_x000B_|\\x0b)", " ", paragraph.text) |
| 90 | |
| 91 | def to_html(self, style_args: StyleArg): |
| 92 | if self.idx == -1: |
| 93 | raise ValueError(f"paragraph {self.idx} is not valid") |
| 94 | tag = "li" if self.bullet else "p" |
| 95 | id_str = f" id='{self.idx}'" if style_args.paragraph_id else "" |
| 96 | font_style = get_font_style(self.font) |
| 97 | style_str = ( |
| 98 | f" style='{font_style}'" if style_args.font_style and font_style else "" |
| 99 | ) |
| 100 | if self.bullet: |
| 101 | style_str += f" bullet-type='{self.bullet}'" |
| 102 | return f"<{tag}{id_str}{style_str}>{self.text}</{tag}>" |
| 103 | |
| 104 | def __repr__(self): |
| 105 | return f"Paragraph-{self.idx}: {self.text}" |
nothing calls this directly
no test coverage detected