Files
old-saburly-wagtail-web/env/lib/python3.10/site-packages/wagtail/utils/text.py
2024-08-27 20:33:44 +02:00

8 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()