MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / _strip_html_markup

Function _strip_html_markup

agents/reading-agent/main.py:620–627  ·  view source on GitHub ↗
(text: Any)

Source from the content-addressed store, hash-verified

618
619def _strip_html_markup(text: Any) -> str:
620 normalized = unescape(str(text or ""))
621 normalized = re.sub(r"(?i)<br\s*/?>", "\n", normalized)
622 normalized = re.sub(r"(?i)</p\s*>", "\n", normalized)
623 normalized = re.sub(r"(?i)<p\b[^>]*>", "", normalized)
624 normalized = re.sub(r"<[^>]+>", " ", normalized)
625 normalized = normalized.replace("\xa0", " ")
626 return _clean_text(normalized)
627
628
629def _looks_like_feed_metadata_abstract(text: Any) -> bool:
630 normalized = _strip_html_markup(text).lower()

Callers 2

_clean_abstract_textFunction · 0.85

Calls 1

_clean_textFunction · 0.70

Tested by

no test coverage detected