dataUriMatcher function

ImageSourceMatcher dataUriMatcher({
  1. String? encoding = 'base64',
  2. String? mime,
})

Implementation

ImageSourceMatcher dataUriMatcher({String? encoding = 'base64', String? mime}) => (attributes, element) {
      if (_src(attributes) == null) return false;
      final dataUri = _dataUriFormat.firstMatch(_src(attributes)!);
      return dataUri != null &&
          (mime == null || dataUri.namedGroup('mime') == mime) &&
          (encoding == null || dataUri.namedGroup('encoding') == ';$encoding');
    };