* Returns the html code to render the smiley.
*
* @param string $class (additional) class(es) of the smiley element
- * @param bool $isAmp
* @return string
*/
- public function getHtml($class = '', $isAmp = false)
+ public function getHtml($class = '')
{
$srcset = ($this->smileyPath2x) ? ' srcset="' . StringUtil::encodeHTML($this->getURL2x()) . ' 2x"' : '';
$height = ($this->getHeight()) ? ' height="' . $this->getHeight() . '"' : '';
$class = ' ' . $class;
}
- $loading = ($isAmp) ? '' : ' loading="eager"';
-
- return '<img src="' . StringUtil::encodeHTML($this->getURL()) . '" alt="' . StringUtil::encodeHTML($this->smileyCode) . '" title="' . WCF::getLanguage()->get($this->smileyTitle) . '" class="smiley' . $class . '"' . $srcset . $height . $width . $loading . '>';
+ return '<img src="' . StringUtil::encodeHTML($this->getURL()) . '" alt="' . StringUtil::encodeHTML($this->smileyCode) . '" title="' . WCF::getLanguage()->get($this->smileyTitle) . '" class="smiley' . $class . '"' . $srcset . $height . $width . ' loading="eager">';
}
}
*/
public function process(array $elements, AbstractHtmlNodeProcessor $htmlNodeProcessor)
{
- $isAmp = ($htmlNodeProcessor instanceof AmpHtmlOutputNodeProcessor);
-
/** @var \DOMElement $element */
foreach ($elements as $element) {
$class = $element->getAttribute('class');
} else {
// Ensure that the smiley's HTML is up to date.
$doc = new \DOMDocument();
- $doc->loadHTML($smiley->getHtml('', $isAmp));
+ $doc->loadHTML($smiley->getHtml());
$smileyNode = $element->ownerDocument->importNode($doc->getElementsByTagName('img')->item(0), true);
$element->parentNode->replaceChild($smileyNode, $element);
}