You are here

private function HtmlAssetInliner::toAbsoluteURLs in TMGMT Translator Smartling 8

Converts relative <a> tag paths to absolute paths

File

src/Context/HtmlAssetInliner.php, line 266

Class

HtmlAssetInliner

Namespace

Drupal\tmgmt_smartling\Context

Code

private function toAbsoluteURLs() {
  $links = $this
    ->getTags('//a');
  foreach ($links as $link) {
    $link
      ->setAttribute('href', $this
      ->getFullUrl($link
      ->getAttribute('href')));
  }
  $this->html = $this->dom
    ->saveHTML();
}