     isAttr: (attr) ->
       attr.length > 0 and attr[0] != '_'
 
-    node: (text, children, open) ->
+    node: (text, type, children, open) ->
       text: text
+      type: type
       children: children or []
       state: { open: open or false }
 

          visited = {}
          visited[obj.id] = 1
          @descend(index, obj, visited)
        @node(type, children)

      if nonempty
        node for node in nodes when node.children.length > 0

          "<span style=\"color:#{color}\">#{value}</span>"
        ])

      @node(html.join(""), "", children)

    isRef: (obj) ->
      _.isObject(obj) and (_.isEqual(_.keys(obj), ["id", "type"]) or
