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

Function _strip_html

agents/coldstart-agent/main.py:588–594  ·  view source on GitHub ↗

Convert a small HTML fragment into plain text.

(value: str)

Source from the content-addressed store, hash-verified

586
587
588def _strip_html(value: str) -> str:
589 """Convert a small HTML fragment into plain text."""
590 if not value:
591 return ""
592 without_scripts = re.sub(r"(?is)<(script|style)[^>]*>.*?</\1>", " ", value)
593 plain = re.sub(r"(?s)<[^>]+>", " ", without_scripts)
594 return _collapse_whitespace(html.unescape(plain))
595
596
597def _extract_first_group(pattern: str, text: str) -> str:

Calls 1

_collapse_whitespaceFunction · 0.85

Tested by

no test coverage detected