Class Node

A BBCode node. This represents a tag and it's children.

Hierarchy (view full)

Implements

Constructors

Properties

attributes: AttributeType

The attributes of the tag.

Ref: AttributeType

children: BaseNode[] = []

The children of the node.

Ref: ChildrenHolder.children

name: string

The name of the tag.

Example

`[b]Hello World![/b]` -> `b`
value?: string

The value of the tag.

Ref: ValueHolder.value

Methods

  • Makes the opening tag of the node. This will include the name, and all attributes.

    Returns string

    The opening tag of the node.

  • Converts the node into a tree-like overview of all children.

    Parameters

    • indentWidth: number = 2

      The number of spaces to indent the output. Defaults to 2.

    Returns string

    The tree-like overview of all children.

  • Gets the children of the node tree.

    Parameters

    • indentWidth: number

      The number of spaces to indent the output.

    Returns string

    The children of the node tree.

  • Converts the node into a textual representation of the node as BBCode. A node should return the exact same string as the input to Parser.parse provided indented is false.

    Returns string

    The textual representation of the node as BBCode.

Generated using TypeDoc