Initial commit
This commit is contained in:
7
env/lib/python3.10/site-packages/wagtail/utils/text.py
vendored
Normal file
7
env/lib/python3.10/site-packages/wagtail/utils/text.py
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
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()
|
||||
Reference in New Issue
Block a user