# HG changeset patch
# User cmlenz
# Date 1155763788 0
# Node ID 8e81177059f3fb405a02a466a70f22e73b7295e4
# Parent 40fc3d36f5b488f8753a08ae408823e563ff9a24
* Add test case for SVG content embedded in an HTML document.
* The XHTML serializer now assumes that elements in a foreign namespace (such as SVG or MathML) can be serialized as empty tags (``).
diff --git a/markup/output.py b/markup/output.py
--- a/markup/output.py
+++ b/markup/output.py
@@ -231,7 +231,7 @@
buf += [' ', attrname, '="', escape(value), '"']
ns_attrib = []
- if (not tag.namespace or tag in namespace) and \
+ if (tag.namespace and tag not in namespace) or \
tagname in empty_elems:
kind, data, pos = stream.next()
if kind is END:
diff --git a/markup/tests/output.py b/markup/tests/output.py
--- a/markup/tests/output.py
+++ b/markup/tests/output.py
@@ -108,6 +108,19 @@
output = XML(text).render(XHTMLSerializer)
self.assertEqual(text, output)
+ def test_embedded_svg(self):
+ text = """
+