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