def text(self, el):
self.quotewrite(el)
+ def rawcode(self, el):
+ self.write(el)
+
def attrval(self, buf):
qc, qt = ("'", "'") if '"' in buf else ('"', """)
self.write(qc)
def endtag(self, el):
self.write('</' + self.elname(el) + '>')
- def longtag(self, el):
+ def longtag(self, el, **extra):
self.starttag(el, **extra)
for ch in el.children:
self.node(ch)
self.element(el)
elif isinstance(el, cons.text):
self.text(el)
+ elif isinstance(el, cons.raw):
+ self.rawcode(el)
else:
raise Exception("Unknown object in element tree: " + el)
def output(cls, out, el, *args, **kw):
cls(out=out, root=el, *args, **kw).start()
+ @classmethod
+ def fragment(cls, out, el, *args, **kw):
+ cls(out=out, root=el, *args, **kw).node(el)
+
def update(self, **ch):
ret = type(self).__new__(type(self))
ret.__dict__.update(self.__dict__)