lexDomTree static method

StyledElement lexDomTree(
  1. Document html,
  2. List<String> customRenderTags,
  3. List<String> tagsList,
  4. NavigationDelegate? navigationDelegateForIframe,
)

lexDomTree converts a DOM document to a simplified tree of StyledElements.

Implementation

static StyledElement lexDomTree(
  dom.Document html,
  List<String> customRenderTags,
  List<String> tagsList,
  NavigationDelegate? navigationDelegateForIframe,
) {
  StyledElement tree = StyledElement(
    name: "[Tree Root]",
    children: <StyledElement>[],
    node: html.documentElement,
    style: Style(),
  );

  html.nodes.forEach((node) {
    tree.children.add(_recursiveLexer(
      node,
      customRenderTags,
      tagsList,
      navigationDelegateForIframe,
    ));
  });

  return tree;
}