File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
app/code/Magento/PageBuilder/Setup/Converters Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 10
10
11
11
use DOMDocument ;
12
12
use DOMElement ;
13
- use DOMException ;
14
- use DOMNode ;
15
13
use DOMXPath ;
16
- use Exception ;
17
14
use Magento \Framework \DB \DataConverter \DataConverterInterface ;
18
15
19
16
/**
@@ -73,11 +70,8 @@ public function convert($value)
73
70
$ document = new DOMDocument ();
74
71
$ document ->loadHTML ($ value );
75
72
$ xpath = new DOMXPath ($ document );
76
-
77
- // Query for Inline Styles
78
- $ nodes = $ xpath ->query ('//*[@style] ' );
79
-
80
- $ styleMap = array ();
73
+ $ nodes = $ xpath ->query ('//*[@style] ' ); // Query for Inline Styles
74
+ $ styleMap = [];
81
75
82
76
foreach ($ nodes as $ node ) {
83
77
/* @var DOMElement $node */
@@ -86,11 +80,7 @@ public function convert($value)
86
80
if ($ styleAttr ) {
87
81
$ generatedDataAttribute = $ this ->generateDataAttribute ();
88
82
$ node ->setAttribute ('data-pb-style ' , $ this ->generateDataAttribute ());
89
-
90
- // Add for Internal Style Generation
91
- $ styleMap [$ generatedDataAttribute ] = $ styleAttr ;
92
-
93
- // Strip Inline Styles
83
+ $ styleMap [$ generatedDataAttribute ] = $ styleAttr ; // Amend Array for Internal Style Generation
94
84
$ node ->removeAttribute ('style ' );
95
85
}
96
86
}
@@ -100,7 +90,6 @@ public function convert($value)
100
90
'style ' ,
101
91
$ this ->generateInternalStyles ($ styleMap )
102
92
);
103
- $ style ->setAttribute ('type ' , 'text/css ' );
104
93
$ xpath ->query ('//body ' )[0 ]->appendChild ($ style ); // @todo: Refactor
105
94
106
95
// @todo: Refactor
You can’t perform that action at this time.
0 commit comments