X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=blobdiff_plain;f=wrw%2Fsp%2Fxhtml.py;fp=wrw%2Fsp%2Fxhtml.py;h=3c6c0f6898333ae89a28bc01b5a106fa17325b05;hp=928dcd9ab46db41d88d3810a257adec64aeb0495;hb=d4220e473079408b9ef4f520462fed3182a692cd;hpb=809f0edc1d621010d0cf62ced892f13ee24fde8e diff --git a/wrw/sp/xhtml.py b/wrw/sp/xhtml.py index 928dcd9..3c6c0f6 100644 --- a/wrw/sp/xhtml.py +++ b/wrw/sp/xhtml.py @@ -14,7 +14,15 @@ class htmlelement(_cons.element): doc.appendChild(self.__todom__(doc)) return doc +class xhtmlcontext(_cons.context): + attrmap = {u"klass": u"class"} + + def addattr(self, node, k, v): + k = unicode(k) + node.attrs[self.attrmap.get(k, k)] = unicode(v) + def cons(ctx=None): + if ctx is None: ctx = xhtmlcontext() return _cons.constructor(ns, htmlelement, ctx) def head(title=None, css=None):