Dolda2000 GitWeb
/
wrw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.dolda2000.com:/srv/git/r/wrw
[wrw.git]
/
wrw
/
sp
/
xhtml.py
diff --git
a/wrw/sp/xhtml.py
b/wrw/sp/xhtml.py
index
abf4b96
..
3c6c0f6
100644
(file)
--- 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
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):
def cons(ctx=None):
+ if ctx is None: ctx = xhtmlcontext()
return _cons.constructor(ns, htmlelement, ctx)
def head(title=None, css=None):
return _cons.constructor(ns, htmlelement, ctx)
def head(title=None, css=None):
@@
-30,7
+38,7
@@
def head(title=None, css=None):
return head
class htmlformatter(util.formatter):
return head
class htmlformatter(util.formatter):
- allowshort = set([u"br", u"hr", u"img", u"input"])
+ allowshort = set([u"br", u"hr", u"img", u"input"
, u"meta", u"link"
])
def element(self, el, **extra):
if el.name in self.allowshort:
super(htmlformatter, self).element(el, **extra)
def element(self, el, **extra):
if el.name in self.allowshort:
super(htmlformatter, self).element(el, **extra)