summaryrefslogtreecommitdiff
path: root/django/utils/html.py
diff options
context:
space:
mode:
authorAlasdair Nicol <alasdair@memset.com>2013-10-22 11:21:07 +0100
committerAlasdair Nicol <alasdair@memset.com>2013-10-23 13:45:03 +0100
commitc3aa2948c6c14862407501290571f858ccf45b07 (patch)
tree6f0812d7db0fe2f5a6bf9e07f20ba7d442ce8789 /django/utils/html.py
parent317040a73b77be8f8210801793b2ce6d1a69301e (diff)
Fixed #21298 -- Fixed E301 pep8 warnings
Diffstat (limited to 'django/utils/html.py')
-rw-r--r--django/utils/html.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/utils/html.py b/django/utils/html.py
index 391862a639..81b06efeef 100644
--- a/django/utils/html.py
+++ b/django/utils/html.py
@@ -118,12 +118,16 @@ class MLStripper(HTMLParser):
HTMLParser.__init__(self)
self.reset()
self.fed = []
+
def handle_data(self, d):
self.fed.append(d)
+
def handle_entityref(self, name):
self.fed.append('&%s;' % name)
+
def handle_charref(self, name):
self.fed.append('&#%s;' % name)
+
def get_data(self):
return ''.join(self.fed)
@@ -285,6 +289,7 @@ def clean_html(text):
# Trim stupid HTML such as <br clear="all">.
text = html_gunk_re.sub('', text)
# Convert hard-coded bullets into HTML unordered lists.
+
def replace_p_tags(match):
s = match.group().replace('</p>', '</li>')
for d in DOTS: