From 20ac33100cd20c17d1ceab075d96698974cc4778 Mon Sep 17 00:00:00 2001 From: Claude Paroz Date: Wed, 6 Feb 2013 21:16:15 +0100 Subject: [PATCH] Partially revert 9efe1a721, strip_tags improvements The new regex seems not stable enough for being released. Stripping with regex might need reevaluation for the next release. Refs #19237. --- django/utils/html.py | 2 +- tests/regressiontests/utils/html.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/django/utils/html.py b/django/utils/html.py index b403e2f0cb6..32a3b0757de 100644 --- a/django/utils/html.py +++ b/django/utils/html.py @@ -33,7 +33,7 @@ link_target_attribute_re = re.compile(r'(]*?)target=[^\s>]+') html_gunk_re = re.compile(r'(?:
|<\/i>|<\/b>|<\/em>|<\/strong>|<\/?smallcaps>|<\/?uppercase>)', re.IGNORECASE) hard_coded_bullets_re = re.compile(r'((?:

(?:%s).*?[a-zA-Z].*?

\s*)+)' % '|'.join([re.escape(x) for x in DOTS]), re.DOTALL) trailing_empty_content_re = re.compile(r'(?:

(?: |\s|
)*?

\s*)+\Z') -strip_tags_re = re.compile(r'])*?>', re.IGNORECASE) +strip_tags_re = re.compile(r'<[^>]*?>', re.IGNORECASE) def escape(text): diff --git a/tests/regressiontests/utils/html.py b/tests/regressiontests/utils/html.py index a0226c47657..cb8c217bfe9 100644 --- a/tests/regressiontests/utils/html.py +++ b/tests/regressiontests/utils/html.py @@ -65,7 +65,6 @@ class TestUtilsHtml(unittest.TestCase): ('b', 'b'), - ('a

b

c', 'abc'), ('a

b

c', 'abc'), ('de

f', 'def'), )