Skip to content

Commit

Permalink
fixup! squash! Fix #72: rewrite the sanitizer to be a treewalker filt…
Browse files Browse the repository at this point in the history
…er only.
  • Loading branch information
gsnedders committed May 8, 2016
1 parent 95a0be3 commit 42fde37
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions html5lib/tests/test_sanitizer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import absolute_import, division, unicode_literals

from html5lib import constants
from html5lib import parseFragment, serialize
from html5lib import constants, parseFragment, serialize
from html5lib.filters import sanitizer


Expand Down Expand Up @@ -29,11 +28,15 @@ def sanitize_html(stream):


def test_should_handle_astral_plane_characters():
assert '<p>\U0001d4b5 \U0001d538</p>' == sanitize_html("<p>&#x1d4b5; &#x1d538;</p>")
sanitized = sanitize_html("<p>&#x1d4b5; &#x1d538;</p>")
expected = '<p>\U0001d4b5 \U0001d538</p>'
assert expected == sanitized


def test_should_allow_relative_uris():
assert '<p><a href="/example.com"></a></p>' == sanitize_html('<p><a href="/example.com"></a></p>')
sanitized = sanitize_html('<p><a href="/example.com"></a></p>')
expected = '<p><a href="/example.com"></a></p>'
assert expected == sanitized


def test_sanitizer():
Expand Down

0 comments on commit 42fde37

Please sign in to comment.