Skip to content

Commit 42fde37

Browse files
committed
fixup! squash! Fix #72: rewrite the sanitizer to be a treewalker filter only.
1 parent 95a0be3 commit 42fde37

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

html5lib/tests/test_sanitizer.py

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__ import absolute_import, division, unicode_literals
22

3-
from html5lib import constants
4-
from html5lib import parseFragment, serialize
3+
from html5lib import constants, parseFragment, serialize
54
from html5lib.filters import sanitizer
65

76

@@ -29,11 +28,15 @@ def sanitize_html(stream):
2928

3029

3130
def test_should_handle_astral_plane_characters():
32-
assert '<p>\U0001d4b5 \U0001d538</p>' == sanitize_html("<p>&#x1d4b5; &#x1d538;</p>")
31+
sanitized = sanitize_html("<p>&#x1d4b5; &#x1d538;</p>")
32+
expected = '<p>\U0001d4b5 \U0001d538</p>'
33+
assert expected == sanitized
3334

3435

3536
def test_should_allow_relative_uris():
36-
assert '<p><a href="/example.com"></a></p>' == sanitize_html('<p><a href="/example.com"></a></p>')
37+
sanitized = sanitize_html('<p><a href="/example.com"></a></p>')
38+
expected = '<p><a href="/example.com"></a></p>'
39+
assert expected == sanitized
3740

3841

3942
def test_sanitizer():

0 commit comments

Comments
 (0)