Skip to content

Commit b9851a8

Browse files
Merge pull request #367 from magento-obsessive-owls/PB-252
[Owls] Dynamic Block Renders Nothing in Admin if Top Row is Hidden
2 parents 3af1aa6 + 3d3da7e commit b9851a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/code/Magento/PageBuilder/Model/Stage/HtmlFilter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ public function filterHtml(string $content): string
4444
try {
4545
//this code is required because of https://bugs.php.net/bug.php?id=60021
4646
$previous = libxml_use_internal_errors(true);
47+
$content = '<div>' . $content . '</div>';
4748
$string = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
4849
$dom->loadHTML($string, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD);
4950
} catch (\Exception $e) {
@@ -82,6 +83,6 @@ public function filterHtml(string $content): string
8283
);
8384
$htmlContentType->nodeValue = htmlentities($innerHTML);
8485
}
85-
return $dom->saveHTML();
86+
return substr(trim($dom->saveHTML()), 5, -6);
8687
}
8788
}

0 commit comments

Comments
 (0)