Mercurial > genshi > mirror
comparison markup/tests/output.py @ 178:ba7556e3a835 trunk
Fix bug in XHTML serialization: all elements were allowed to be written out as empty if the namespace was set.
author | cmlenz |
---|---|
date | Mon, 21 Aug 2006 15:36:29 +0000 |
parents | 553866249cb0 |
children | 0141f45c18e1 |
comparison
equal
deleted
inserted
replaced
177:553866249cb0 | 178:ba7556e3a835 |
---|---|
93 text = '<foo xml:space="preserve"> Do not mess \n\n with me </foo>' | 93 text = '<foo xml:space="preserve"> Do not mess \n\n with me </foo>' |
94 output = XML(text).render(XHTMLSerializer) | 94 output = XML(text).render(XHTMLSerializer) |
95 self.assertEqual(text, output) | 95 self.assertEqual(text, output) |
96 | 96 |
97 def test_empty_script(self): | 97 def test_empty_script(self): |
98 text = '<script src="foo.js" />' | 98 text = """<html xmlns="http://www.w3.org/1999/xhtml"> |
99 <script src="foo.js" /> | |
100 </html>""" | |
99 output = XML(text).render(XHTMLSerializer) | 101 output = XML(text).render(XHTMLSerializer) |
100 self.assertEqual('<script src="foo.js"></script>', output) | 102 self.assertEqual("""<html xmlns="http://www.w3.org/1999/xhtml"> |
103 <script src="foo.js"></script> | |
104 </html>""", output) | |
101 | 105 |
102 def test_script_escaping(self): | 106 def test_script_escaping(self): |
103 text = """<script>/*<![CDATA[*/ | 107 text = """<script>/*<![CDATA[*/ |
104 if (1 < 2) { alert("Doh"); } | 108 if (1 < 2) { alert("Doh"); } |
105 /*]]>*/</script>""" | 109 /*]]>*/</script>""" |