Merge branch 'master' into python3
authorFredrik Tolf <fredrik@dolda2000.com>
Sat, 28 Dec 2013 05:48:03 +0000 (06:48 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Sat, 28 Dec 2013 05:48:03 +0000 (06:48 +0100)
Conflicts:
wrw/sp/util.py

1  2 
wrw/sp/util.py

diff --cc 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))
      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()
 -        super(indenter, self).endtag(el)
+             self.lastendbr = True
 +        super().endtag(el)
  
      def start(self, el):
 -        super(indenter, self).start(el)
 +        super().start(el)
          self.atbreak = True
  
      def end(self, el):