Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42fde37

Browse files
committed
fixup! squash!Fix#72: rewrite the sanitizer to be a treewalker filter only.
1 parent95a0be3 commit42fde37

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎html5lib/tests/test_sanitizer.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from __future__importabsolute_import,division,unicode_literals
22

3-
fromhtml5libimportconstants
4-
fromhtml5libimportparseFragment,serialize
3+
fromhtml5libimportconstants,parseFragment,serialize
54
fromhtml5lib.filtersimportsanitizer
65

76

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

3029

3130
deftest_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+
assertexpected==sanitized
3334

3435

3536
deftest_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+
assertexpected==sanitized
3740

3841

3942
deftest_sanitizer():

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp