generateFromHTML method
T?
generateFromHTML(
- String htmlRoot, {
- DOMTreeMap<
T> ? treeMap, - DOMElement? domParent,
- T? parent,
- DOMContext<
T> ? context, - bool finalizeTree = true,
- bool setTreeMapRoot = true,
Same as generate, but parses htmlRoot
first.
Implementation
T? generateFromHTML(String htmlRoot,
{DOMTreeMap<T>? treeMap,
DOMElement? domParent,
T? parent,
DOMContext<T>? context,
bool finalizeTree = true,
bool setTreeMapRoot = true}) {
var root = $htmlRoot(htmlRoot,
defaultTagDisplayInlineBlock: false,
defaultRootTag: parent != null ? 'dom-builder-html-root' : null);
if (root == null) return null;
if (root.tag == 'dom-builder-html-root') {
var rootParent = parent != null ? getNodeParent(parent) : null;
return generateWithRoot(domParent, parent, root.content!,
treeMap: treeMap,
rootParent: rootParent,
context: context,
finalizeTree: finalizeTree,
setTreeMapRoot: setTreeMapRoot);
} else {
return generate(root,
treeMap: treeMap,
parent: parent,
context: context,
finalizeTree: finalizeTree,
setTreeMapRoot: setTreeMapRoot);
}
}