Skip to content

Commit

Permalink
fix(php): fixed mb_convert_encoding deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
COil committed Oct 10, 2023
1 parent c064416 commit 390245a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Twig/Extension/MarkdownExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ public function getFilters(): array

/**
* Add the "att" attributes on all links to have the tooltips.
*
* @see https://www.drupal.org/project/smart_trim/issues/3342481#comment-14982548
*/
public function addAttAttributes(string $html): string
{
$dom = new \DOMDocument();
$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'), LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
$dom->loadHTML(mb_encode_numericentity($html, [0x80, 0x10FFFF, 0, ~0], 'UTF-8'));
$aTags = $dom->getElementsByTagName('a');
foreach ($aTags as $aTag) {
$aTag->setAttribute('att', '');
Expand Down

0 comments on commit 390245a

Please sign in to comment.