guessTitle method

Future<String?> guessTitle()

Implementation

Future<String?> guessTitle() async {
  List<Link> links = await this.links();
  Link? firstLink = (links).firstOrNull;
  if (firstLink == null) {
    return null;
  }
  File? commonFirstComponent = links.hrefCommonFirstComponent();
  if (commonFirstComponent == null) {
    return null;
  }
  String name = basename(commonFirstComponent.path);
  if (name == firstLink.href.removePrefix("/")) {
    return null;
  }
  return name;
}