convertTextInsertToDomNode method

Node convertTextInsertToDomNode(
  1. TextInsert textInsert
)

Implementation

dom.Node convertTextInsertToDomNode(TextInsert textInsert) {
  final text = textInsert.text;
  final attributes = textInsert.attributes;

  if (attributes == null) {
    return dom.Text(text);
  }

  // if there is only one attribute, we can use the tag directly
  if (attributes.length == 1) {
    return convertSingleAttributeTextInsertToDomNode(text, attributes);
  }

  return convertMultipleAttributeTextInsertToDomNode(text, attributes);
}