Skip to content

Commit 60d8c8a

Browse files
committed
MC-15022: HTML Content type does not render self closing html tags on storefront
Add comment and remove redundant assignment
1 parent e1e2ca2 commit 60d8c8a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/PageBuilder/Plugin/Filter/TemplatePlugin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ private function convertEncodedHtmlContentTypesToPlaceholders(
150150
): void {
151151
$xpath = new \DOMXPath($document);
152152

153-
$uniqueNodeNameToDecodedOuterHtmlMap = [];
154-
155153
/** @var $htmlContentTypeNodes \DOMNode[] */
156154
$htmlContentTypeNodes = $xpath->query('//*[@data-content-type="html" and not(@data-decoded="true")]');
157155

@@ -170,6 +168,9 @@ private function convertEncodedHtmlContentTypesToPlaceholders(
170168
$preDecodedOuterHtml = $document->saveHTML($htmlContentTypeNode);
171169
$decodedOuterHtml = html_entity_decode($preDecodedOuterHtml);
172170

171+
// generate unique node name element to replace with decoded html contents at end of processing;
172+
// goal is to create a document as few times as possible to prevent inadvertent parsing of contents as html
173+
// by the dom library
173174
$uniqueNodeName = 'a' . md5(uniqid('', true));
174175

175176
$uniqueNode = new \DOMElement($uniqueNodeName);

0 commit comments

Comments
 (0)