Class: HTMLNode

lib/compiler/parser/htmlTree.HTMLNode(type, tagNameopt, attrsopt, isSelfClosingopt)

A lightweight node representation for parsing HTML templates.

Constructor

new HTMLNode(type, tagNameopt, attrsopt, isSelfClosingopt)

Creates an instance of HTMLNode.

Parameters:
Name Type Attributes Default Description
type string

The node type.

tagName string <optional>

The tag name.

attrs Object <optional>

The attribute map.

isSelfClosing boolean <optional>
false

Whether the tag is self-closing.

Source:

Members

children :Array:.<HTMLNode:>

Type:
  • Array:.<HTMLNode:>
Source:

contracts :Set:.<string:>

Type:
  • Set:.<string:>
Source:

rawAttrs :string

The tag's attribute text exactly as written, for consumers that need the source rather than the parsed map. Set by parseHTML; nodes built by hand leave it empty.

Type:
  • string
Source:

Methods

initContracts()

Initializes contracts attached to this node via tag names or attributes.

Source: