import html as html_mod
import re


def strip_html(text: str) -> str:
    clean = re.sub(r"<[^>]+>", "", text)
    return html_mod.unescape(clean).strip()


def clean_whitespace(text: str) -> str:
    return re.sub(r"\s+", " ", text).strip()
