perf: Remove bleach from import tree
This commit is contained in:
parent
9b90d88170
commit
293c1c77e3
1 changed files with 5 additions and 1 deletions
|
|
@ -2,11 +2,12 @@ from __future__ import unicode_literals
|
|||
import frappe
|
||||
import json
|
||||
import re
|
||||
import bleach
|
||||
import bleach_whitelist.bleach_whitelist as bleach_whitelist
|
||||
from six import string_types
|
||||
|
||||
def clean_html(html):
|
||||
import bleach
|
||||
|
||||
if not isinstance(html, string_types):
|
||||
return html
|
||||
|
||||
|
|
@ -18,6 +19,8 @@ def clean_html(html):
|
|||
strip=True, strip_comments=True)
|
||||
|
||||
def clean_email_html(html):
|
||||
import bleach
|
||||
|
||||
if not isinstance(html, string_types):
|
||||
return html
|
||||
|
||||
|
|
@ -54,6 +57,7 @@ def sanitize_html(html, linkify=False):
|
|||
|
||||
Does not sanitize JSON, as it could lead to future problems
|
||||
"""
|
||||
import bleach
|
||||
from bs4 import BeautifulSoup
|
||||
|
||||
if not isinstance(html, string_types):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue