buildText method

T? buildText(
  1. DOMElement? domParent,
  2. T? parent,
  3. TextNode domNode,
  4. DOMTreeMap<T> treeMap,
)

Implementation

T? buildText(DOMElement? domParent, T? parent, TextNode domNode,
    DOMTreeMap<T> treeMap) {
  if (domParent != null) {
    domNode.parent = domParent;
  }

  var text = getDOMNodeText(domNode);

  T? textNode;
  if (parent != null) {
    textNode = appendElementText(parent, text);
  } else {
    textNode = createTextNode(text);
  }

  if (textNode != null) {
    treeMap.map(domNode, textNode);
  }

  return textNode;
}