selectByTag<T extends DOMNode> method
Returns a node T
that is one of tags
.
Implementation
T? selectByTag<T extends DOMNode>(List<String>? tags) {
if (isEmptyObject(tags) || isEmptyContent) return null;
tags = tags!
.whereType<String>()
.map((c) => c.trim())
.where((c) => c.isNotEmpty)
.toList();
if (tags.isEmpty) return null;
return selectWhere((n) => n is DOMElement && tags!.contains(n.tag));
}