retargetAllHrefs static method

dynamic retargetAllHrefs(
  1. HtmlDocument htmlDoc, [
  2. String target = '_blank'
])

Implementation

static retargetAllHrefs(HtmlDocument htmlDoc, [String target = '_blank']) {
  log.info('Function : retargetAllHrefs, '
      'Parameters : {[htmlDoc,$htmlDoc][target,$target]}');
  htmlDoc.querySelectorAll('a').forEach((Element e) {
    log.finest(
        'Function : retargetAllHrefs, old : ${e.attributes['target']}');
    e.attributes['target'] = target;
    log.finest(
        'Function : retargetAllHrefs, new : ${e.attributes['target']}');
  });
  log.fine('Function : retargetAllHrefs, Return : void');
}