lexDomTree static method
StyledElement
lexDomTree(
- Document html,
- List<
String> customRenderTags, - List<
String> tagsList, - BuildContext context,
lexDomTree converts a DOM document to a simplified tree of StyledElements.
Implementation
static StyledElement lexDomTree(
dom.Document html,
List<String> customRenderTags,
List<String> tagsList,
BuildContext context,
) {
StyledElement tree = StyledElement(
name: "[Tree Root]",
children: <StyledElement>[],
node: html.documentElement,
style: Style.fromTextStyle(Theme.of(context).textTheme.bodyMedium!),
);
html.nodes.forEach((node) {
tree.children.add(_recursiveLexer(
node,
customRenderTags,
tagsList,
));
});
return tree;
}