File tree Expand file tree Collapse file tree 2 files changed +103
-26
lines changed
app/code/Magento/PageBuilder/Setup/Converters
dev/tests/integration/testsuite/Magento/PageBuilder/Setup/Converters Expand file tree Collapse file tree 2 files changed +103
-26
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,9 @@ public function __construct(DOMDocument $domDocument)
34
34
/**
35
35
* Generates `mageUtils.uniqueid()` Naming Convention
36
36
*
37
- * @param int $length
38
37
* @return string
39
- * @todo Refactor `$length` Param
40
38
*/
41
- private function generateDataAttribute (int $ length = 7 ): string
39
+ private function generateDataAttribute (): string
42
40
{
43
41
return strtoupper (uniqid ());
44
42
}
@@ -66,12 +64,14 @@ private function generateInternalStyles(array $styleMap): string
66
64
*/
67
65
public function convert ($ value )
68
66
{
67
+ libxml_use_internal_errors (true );
69
68
$ document = new DOMDocument ();
70
69
$ document ->loadHTML ($ value );
71
70
$ xpath = new DOMXPath ($ document );
71
+ libxml_clear_errors ();
72
72
73
73
$ body = $ document ->documentElement ->lastChild ;
74
- $ nodes = $ xpath ->query ('//*[@style] ' ); // Query for Inline Styles
74
+ $ nodes = $ xpath ->query ('//*[@data-content-type][@style]|//*[@data-content-type]/*[@ style] ' ); // Query for Inline Styles
75
75
$ styleMap = [];
76
76
77
77
foreach ($ nodes as $ node ) {
You can’t perform that action at this time.
0 commit comments