MCPcopy Create free account
hub / github.com/RASAAS/docmcp-knowledge / html_to_markdown

Method html_to_markdown

scripts/migrate_posts.py:134–142  ·  view source on GitHub ↗
(self, html: str)

Source from the content-addressed store, hash-verified

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)

Callers 1

save_postMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected