Node class

Represents a node in the syntax-highlighted code tree.

Each node contains styled text segments and can have child nodes, forming a tree structure that represents the highlighted code. Nodes with a className are typically wrapped in HTML spans with the appropriate CSS class for styling.

Properties:

  • className: CSS class name for styling (e.g., 'keyword', 'string')
  • value: The actual text content (if it's a leaf node)
  • children: Child nodes (if this node contains other nodes)
  • noPrefix: Whether to skip the 'hljs-' prefix when generating HTML

Constructors

Node({String? className, String? value, List<Node>? children, bool noPrefix = false})

Properties

children List<Node>?
Child nodes of this node (only set for branch nodes).
getter/setter pair
className String?
CSS class name to apply to this node's text. Used for syntax highlighting styling.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
noPrefix bool
Whether to omit the 'hljs-' prefix when converting to HTML.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value String?
The text content of this node (only set for leaf nodes).
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited