JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
fix tests: serialize namespaces
authorJason Woofenden <jason@jasonwoof.com>
Wed, 23 Dec 2015 17:09:58 +0000 (12:09 -0500)
committerJason Woofenden <jason@jasonwoof.com>
Wed, 23 Dec 2015 17:09:58 +0000 (12:09 -0500)
parse-html.coffee
test.coffee

index a6894cd..ca5a804 100644 (file)
@@ -4257,3 +4257,6 @@ module.exports.TYPE_TAG = TYPE_TAG
 module.exports.TYPE_TEXT = TYPE_TEXT
 module.exports.TYPE_COMMENT = TYPE_COMMENT
 module.exports.TYPE_DOCTYPE = TYPE_DOCTYPE
+module.exports.NS_HTML = NS_HTML
+module.exports.NS_MATHML = NS_MATHML
+module.exports.NS_SVG = NS_SVG
index 9fe1293..274940b 100644 (file)
@@ -7796,7 +7796,12 @@ serialize_els = (els, prefix = '| ') ->
        for el in els
                switch el.type
                        when wheic.TYPE_TAG
-                               ret += "#{prefix}<#{el.name}>\n"
+                               ret += "#{prefix}<"
+                               if el.namespace is wheic.NS_MATHML
+                                       ret += "math "
+                               if el.namespace is wheic.NS_SVG
+                                       ret += "svg "
+                               ret += "#{el.name}>\n"
                                attr_keys = []
                                for k of el.attrs
                                        attr_keys.push k