isFullHtmlPage static method

bool isFullHtmlPage(
  1. String src
)

Checks if the source looks like HTML

Implementation

static bool isFullHtmlPage(String src) {
  final _src = src.trim().toLowerCase();
  return _src.startsWith(RegExp('<!DOCTYPE html>', caseSensitive: false)) &&
      // I didn't forget the closing bracket here.
      // Html opening tag may also have some random attributes.
      _src.contains(RegExp('<html', caseSensitive: false)) &&
      _src.contains(RegExp('</html>', caseSensitive: false));
}