Commit 2871e257 authored by Hossein Hosni's avatar Hossein Hosni
Browse files

Update src/Dom/Tag.php

parent ce8ce004
Pipeline #3617 failed with stages
in 6 minutes and 17 seconds
......@@ -205,17 +205,20 @@ class Tag
*/
public function getStyleAttributeArray(): array
{
$value = $this->getAttribute('style')['value'];
if ($value === null) {
$value = $this->getAttribute('style');
if (!$value) {
return [];
}
$value = $value['value'];
$value = explode(';', substr(trim($value), 0, -1));
$result = [];
foreach ($value as $attr) {
if (!$attr) {
continue;
}
$attr = explode(':', $attr);
$result[$attr[0]] = $attr[1];
$result[trim($attr[0])] = trim($attr[1]);
}
return $result;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment