angrybeanie_wagtail/env/lib/python3.12/site-packages/wagtail/utils/text.py
2025-07-25 21:32:16 +10:00

7 lines
233 B
Python

from bs4 import BeautifulSoup
from django.utils.encoding import force_str
def text_from_html(val):
# Return the unescaped text content of an HTML string
return BeautifulSoup(force_str(val), "html.parser").getText().strip()