From: Fredrik Tolf Date: Sat, 28 Dec 2013 05:48:03 +0000 (+0100) Subject: Merge branch 'master' into python3 X-Git-Url: http://dolda2000.com/gitweb/?p=wrw.git;a=commitdiff_plain;h=537064f6656c313c601126692d31628a85de663d Merge branch 'master' into python3 Conflicts: wrw/sp/util.py --- 537064f6656c313c601126692d31628a85de663d diff --cc wrw/sp/util.py index 5138f17,2599206..931cbdb --- a/wrw/sp/util.py +++ b/wrw/sp/util.py @@@ -229,9 -229,10 +229,10 @@@ class indenter(formatter) self.inline = False self.stack = [] self.last = None, None + self.lastendbr = True def write(self, text): - lines = text.split(u"\n") + lines = text.split("\n") if len(lines) > 1: for ln in lines[:-1]: self.buf.extend(ln.encode(self.charset)) @@@ -279,12 -280,15 +280,15 @@@ def endtag(self, el): il = self.inline self.pop() - if not il: + if il or (self.last[0] == ">" and self.last[1] == el): + self.lastendbr = False + else: self.br() + self.lastendbr = True - super(indenter, self).endtag(el) + super().endtag(el) def start(self, el): - super(indenter, self).start(el) + super().start(el) self.atbreak = True def end(self, el):