     output.enter()
     parser = new Parser()
     parser.parse data, (errors, window) =>
-      this.children window.document.body, output
+      @children window.document.body, output
     output.leave()
 
 class Output

    @helper.forEachChild parent, (child) =>
      nodeType = child.nodeType
      if nodeType is 1 # element
        this.element child, output
      else if nodeType is 3 # text
        this.text child, output
      else if nodeType is 8 # comment
        this.comment child, output
      else
        output.writeln '*** nodeType: ' + nodeType
    output.leave()
      
  text: (node, output) ->
    node.normalize()
    @helper.writeText node, output
  

    
  writeTextContent: (node, output, pipe = true, trim = true, wrap = true) ->
    output.enter()
    @forEachChild node, (child) =>
      @writeText child, output, pipe, trim, wrap
    output.leave()


  writeText: (node, output, pipe = true, trim = true, wrap = true, escapeFirstChar = false) ->
    if node.nodeType is 3
      data = node.data or ''
      if data.length > 0
        lines = data.split(/\r|\n/)
        lines.forEach (line) =>
          @writeTextLine line, output, pipe, trim, wrap
              
  writeTextLine: (line, output, pipe = true, trim = true, wrap = true) ->
    prefix = if pipe then '| ' else ''
