(self, html: str)
| 132 | return DEFAULT_SUBCATEGORY |
| 133 | |
| 134 | def html_to_markdown(self, html: str) -> str: |
| 135 | if not html: |
| 136 | return "" |
| 137 | md = self.h2t.handle(html) |
| 138 | md = re.sub(r"\n{3,}", "\n\n", md) |
| 139 | md = md.replace("…", "...").replace("&", "&") |
| 140 | md = md.replace("–", "-").replace("—", "--") |
| 141 | md = md.replace("&", "&").replace(" ", " ") |
| 142 | return md.strip() |
| 143 | |
| 144 | def clean_title(self, title_raw: str) -> str: |
| 145 | t = re.sub(r"<[^>]+>", "", title_raw) |