parseLayoutElement function
Implementation
LayoutElement parseLayoutElement(
dom.Element element,
List<StyledElement> children,
) {
switch (element.localName) {
case "details":
if (children.isEmpty) {
return EmptyLayoutElement(name: "empty");
}
return DetailsContentElement(
node: element,
name: element.localName!,
children: children,
elementList: element.children
);
case "table":
return TableLayoutElement(
name: element.localName!,
children: children,
node: element,
);
case "thead":
case "tbody":
case "tfoot":
return TableSectionLayoutElement(
name: element.localName!,
children: children,
);
case "tr":
return TableRowLayoutElement(
name: element.localName!,
children: children,
node: element,
);
default:
return TableLayoutElement(
children: children,
name: "[[No Name]]",
node: element
);
}
}