visitElement method
void
visitElement(
- Element node
)
override
Implementation
@override
void visitElement(Element node) {
final tag = node.localName;
_str.write('<<code class="markup element-name">$tag</code>');
if (node.attributes.isNotEmpty) {
node.attributes.forEach((key, v) {
v = htmlSerializeEscape(v, attributeMode: true);
_str.write(' <code class="markup attribute-name">$key</code>'
'=<code class="markup attribute-value">"$v"</code>');
});
}
if (node.nodes.isNotEmpty) {
_str.write('>');
visitChildren(node);
} else if (isVoidElement(tag)) {
_str.write('>');
return;
}
_str.write('</<code class="markup element-name">$tag</code>>');
}