Node.root constructor

Node.root(
  1. Object input, {
  2. String? rootTag,
  3. required bool removeLeadingWhitespaces,
})

Implementation

factory Node.root(Object input, {String? rootTag, required bool removeLeadingWhitespaces }) {
  if (rootTag == null || rootTag.isEmpty) {
    rootTag = 'html';
  }
  final dom.Node root = input is dom.Node ? input : parse(input).getElementsByTagName(rootTag).first;
  return Node(util.prepareRoot(root, removeLeadingWhitespaces));
}