convertMultipleAttributeTextInsertToDomNode method

Element convertMultipleAttributeTextInsertToDomNode(
  1. String text,
  2. Attributes attributes
)

Implementation

dom.Element convertMultipleAttributeTextInsertToDomNode(
  String text,
  Attributes attributes,
) {
  //rich editor for webs do this so handling that case for href  <a href="https://www.google.com" rel="noopener noreferrer" target="_blank"><strong><em><u>demo</u></em></strong></a>
  final element = hrefEdgeCaseAttributes(text, attributes);
  if (element != null) {
    return element;
  }
  final span = dom.Element.tag(HTMLTags.span);
  final cssString = convertAttributesToCssStyle(attributes);
  if (cssString.isNotEmpty) {
    span.attributes['style'] = cssString;
  }
  span.append(dom.Text(text));
  return span;
}