         this
 
     children: (children, {direct} = {}) =>
-        if typeof children is 'function'
-            if direct
+        return this unless children?
+        unless typeof children is 'function'
+            content = children
+            children = =>
+                @text content
+        if direct
+            children.call this
+        else
+            @_delayed = [] # mark that this tag has a delayed children scope
+            process.nextTick =>
+                [delayed, @_delayed] = [@_delayed, null] # turn off
                 children.call this
-            else
-                process.nextTick =>
-                    children.call this
-        else if children isnt undefined
-            @text children
+                for method in delayed
+                    method.call this
         this
 
     text: (content, opts = {}) =>

        @Tag = @opts.Tag or Tag # inherit (maybe) extended tag class
        @buffer = [] # after this tag all children emitted data
        @pending = [] # no open child tag
        @closed = false
        @writable = true
        @content = ""

    up: () -> null # this node has no parent

    end: () =>
        if @_delayed?
            @_delayed.push @end
            return this
        if not @closed
            if @headers
                data = "#{indent this}#{@headers}/>"
