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

Method clean_title

scripts/migrate_wordpress.py:171–177  ·  view source on GitHub ↗

Clean HTML entities from title.

(self, title_raw: str)

Source from the content-addressed store, hash-verified

169 return md.strip()
170
171 def clean_title(self, title_raw: str) -> str:
172 """Clean HTML entities from title."""
173 t = re.sub(r"<[^>]+>", "", title_raw)
174 t = t.replace("&amp;", "&").replace("&#8211;", "-")
175 t = t.replace("&#038;", "&").replace("&hellip;", "...")
176 t = t.replace("&#8212;", "--").replace("&nbsp;", " ")
177 return t.strip()
178
179 def slugify(self, text: str) -> str:
180 """Convert text to URL-safe slug."""

Callers 3

build_front_matterMethod · 0.95
save_documentMethod · 0.95
migrateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected