 
     onclose: (el) ->
         el._stream.write =>
-            unless el.closed is 'self' or el is el.builder
+            unless el.isempty or el is el.builder
                 @write prettify el, "</#{el.name}>"
             # call next callback of the registered 'ready' checker
             el._stream_ready?()

        @opened_tags++
        el._stream.write =>
            return if el is el.builder
            if el.closed is 'self'
                @write prettify el, "<#{el.name}#{attrStr el.attrs}/>"
            else
                @write prettify el, "<#{el.name}#{attrStr el.attrs}>"

        @order.on('entry', ({job}) -> job?())
        # tell the parent to write this entry when its time
        @parent?._stream.write =>
            @release() if not el.isempty or el.closed is yes
            @isnext = yes
        # get the order position of this entry
        idx = @parent?._stream.children ? -1
