parse static method

List<UEditorBlock> parse(
  1. String? html
)

Implementation

static List<UEditorBlock> parse(String? html) {
  final String input = (html ?? "").trim();
  if (input.isEmpty) return <UEditorBlock>[UEditorBlock.text(UBlockType.paragraph)];

  final List<_Node> nodes = _Parser(input).parse();
  final List<UEditorBlock> blocks = <UEditorBlock>[];
  _walkTopLevel(nodes, blocks);

  if (blocks.isEmpty) blocks.add(UEditorBlock.text(UBlockType.paragraph));
  return blocks;
}