Skip to content

Commit baa4a36

Browse files
committed
Remove </embed> from tests
Newest parser in libxml2 is stricker and does not allow embed tags to have closing tags. Fixes: #29
1 parent 6bb199c commit baa4a36

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/test_clean_embed.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@ THIS FAILS IN libxml2 2.6.29 AND 2.6.30 !!
1313
... return s
1414

1515
>>> doc_embed = '''<div>
16-
... <embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash"></embed>
17-
... <embed src="http://anothersite.com/v/another"></embed>
16+
... <embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash">
17+
... <embed src="http://anothersite.com/v/another">
1818
... <script src="http://www.youtube.com/example.js"></script>
1919
... <script src="/something-else.js"></script>
2020
... </div>'''
2121
>>> print(tostring(fromstring(doc_embed)))
2222
<div>
23-
<embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash"></embed>
24-
<embed src="http://anothersite.com/v/another"></embed>
23+
<embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash">
24+
<embed src="http://anothersite.com/v/another">
2525
<script src="http://www.youtube.com/example.js"></script>
2626
<script src="/something-else.js"></script>
2727
</div>
@@ -30,10 +30,10 @@ THIS FAILS IN libxml2 2.6.29 AND 2.6.30 !!
3030
</div>
3131
>>> print(Cleaner(host_whitelist=['www.youtube.com']).clean_html(doc_embed))
3232
<div>
33-
<embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash"></embed>
33+
<embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash">
3434
</div>
3535
>>> print(Cleaner(host_whitelist=['www.youtube.com'], whitelist_tags=None).clean_html(doc_embed))
3636
<div>
37-
<embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash"></embed>
37+
<embed src="http://www.youtube.com/v/183tVH1CZpA" type="application/x-shockwave-flash">
3838
<script src="http://www.youtube.com/example.js"></script>
3939
</div>

0 commit comments

Comments
 (0)