Merge branch 'master' into python3
authorFredrik Tolf <fredrik@dolda2000.com>
Sun, 15 Sep 2013 22:41:53 +0000 (00:41 +0200)
committerFredrik Tolf <fredrik@dolda2000.com>
Sun, 15 Sep 2013 22:41:53 +0000 (00:41 +0200)
Conflicts:
wrw/sp/cons.py
wrw/sp/xhtml.py

wrw/sp/cons.py
wrw/sp/xhtml.py

index c4d9999..205de03 100644 (file)
@@ -59,7 +59,8 @@ class context(object):
         node.children.append(self.nodefrom(child))
 
     def addattr(self, node, k, v):
-        node.attrs[str(k)] = str(v)
+        if v is not None:
+            node.attrs[str(k)] = str(v)
 
 class constructor(object):
     def __init__(self, ns, elcls=element, ctx=None):
index 5f1ca45..50c70b6 100644 (file)
@@ -19,7 +19,7 @@ class xhtmlcontext(_cons.context):
 
     def addattr(self, node, k, v):
         k = str(k)
-        node.attrs[self.attrmap.get(k, k)] = str(v)
+        super().addattr(node, self.attrmap.get(k, k), v)
 
 def cons(ctx=None):
     if ctx is None: ctx = xhtmlcontext()