X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=wrw%2Fsp%2Fxhtml.py;h=f10d3158fe53fdc2eb8e5c6140b8e9feb53fef72;hb=4c4dcf7a020ed52ea9d8d9048dbd62ffa3a7d54d;hp=447c1b17827a659016f636cbc12d97ffd3c97012;hpb=d22f3483df089fc239b4182807c12aaab5ab1c7d;p=wrw.git diff --git a/wrw/sp/xhtml.py b/wrw/sp/xhtml.py index 447c1b1..f10d315 100644 --- a/wrw/sp/xhtml.py +++ b/wrw/sp/xhtml.py @@ -19,7 +19,7 @@ class xhtmlcontext(_cons.context): def addattr(self, node, k, v): k = unicode(k) - node.attrs[self.attrmap.get(k, k)] = unicode(v) + super(xhtmlcontext, self).addattr(node, self.attrmap.get(k, k), v) def cons(ctx=None): if ctx is None: ctx = xhtmlcontext() @@ -53,7 +53,9 @@ def forreq(req, tree): req.ohead["Content-Type"] = "text/html; charset=utf-8" buf = StringIO.StringIO() htmlindenter.output(buf, tree, doctype=(doctype, dtd), charset="utf-8") - return [buf.getvalue()] + ret = buf.getvalue() + req.ohead["Content-Length"] = len(ret) + return [ret] def xhtmlresp(callable): def wrapper(req):