+ if isinstance(ch, cons.text):
+ return True
+ return False
+
+ def push(self, el):
+ self.stack.append((el, self.curind, self.inline))
+
+ def pop(self):
+ el, self.curind, self.inline = self.stack.pop()
+ return el
+
+ def starttag(self, el):
+ if not self.inline:
+ self.br()
+ self.push(el)
+ self.inline = self.inline or self.inlinep(el)
+ self.curind += self.indent
+ super(indenter, self).starttag(el)
+
+ def shorttag(self, el):
+ if not self.inline:
+ self.br()
+ super(indenter, self).shorttag(el)
+
+ def endtag(self, el):
+ il = self.inline
+ self.pop()
+ if not il:
+ self.br()
+ super(indenter, self).endtag(el)