Closed peterjaap closed 6 years ago
That produced ugly output. Better yet, we created plugins for the three MetaProviders that return nice output. One example;
<?php
namespace Elgentos\FixYoastSeo\Plugin\Product;
class MetaProviderPlugin
{
public function afterGetOpenGraphDescription(\MaxServ\YoastSeo\Model\EntityConfiguration\Catalog\Product\MetaProvider $subject, $result)
{
return trim(preg_replace('#<[^>]+>#', ' ', $result));
}
}
issue has been fixed in 2.0.0
So we get stuff like this;
... etc
Because the HTML is closed, the actual text shows on top of the page.
We now have overriden
vendor/maxserv/magento-module-yoastseo/view/frontend/templates/yoastseo.phtml
in our theme and changed;<meta property="og:description" content="<?php echo $meta->getOpenGraphDescription(); ?>"/>
to;
<meta property="og:description" content="<?= $block->escapeHtmlAttr($block->stripTags($meta->getOpenGraphDescription())) ?>"/>