You are here

protected function PageProcessor::processTagImg in Mini site 8

Process <img> tag.

Parameters

\DOMNode $item: Document node object to process.

1 call to PageProcessor::processTagImg()
PageProcessor::process in src/PageProcessor.php
Process document.

File

src/PageProcessor.php, line 244

Class

PageProcessor
Class PageProcessor.

Namespace

Drupal\minisite

Code

protected function processTagImg(\DOMNode $item) {
  $url = $item
    ->getAttribute('src');
  if (!$url) {
    return;
  }
  $item
    ->setAttribute('src', UrlValidator::relativeToRoot($url, $this->urlBag
    ->getAssetDir() . '/' . $this->urlBag
    ->getRootDir()));
}