217 $result[static::DISPLAY] = static::DISPLAY_HIDDEN;
224 $styles = $node->getStyle();
229 $stylePairs = explode(
';', $styles);
230 foreach($stylePairs as $pair)
232 [
$name, $value] = explode(
':', $pair);
236 $value = trim($value);
237 if(
$name == static::DISPLAY)
241 $display = static::DISPLAY_HIDDEN;
245 $display = static::DISPLAY_BLOCK;
247 elseif($value ==
'inline')
249 $display = static::DISPLAY_INLINE;
254 if(intval($value) > 500 || $value ==
'bold')
256 $font[static::FONT_BOLD] =
true;
258 elseif(intval($value) < 500 || $value ==
'normal')
260 $font[static::FONT_BOLD] =
false;
265 if($value ==
'italic' || str_starts_with($value,
'oblique'))
267 $font[static::FONT_ITALIC] =
true;
269 elseif($value ==
'normal')
271 $font[static::FONT_ITALIC] =
false;
276 if(str_contains($value,
'underline'))
278 $font[static::FONT_UNDERLINED] =
true;
280 if(str_contains($value,
'line-through'))
282 $font[static::FONT_DELETED] =
true;
286 $font[static::FONT_UNDERLINED] =
false;
287 $font[static::FONT_DELETED] =
false;
293 if($display == static::DISPLAY_HIDDEN)
295 $result[static::DISPLAY] = $display;
299 if(!$display && $this->
isBlockTag($node->getTagName()))
301 $display = static::DISPLAY_BLOCK;
304 if(!isset($font[static::FONT_BOLD]) && $this->
isBoldTag($node->getTagName()))
306 $font[static::FONT_BOLD] =
true;
308 if(!isset($font[static::FONT_ITALIC]) && $this->
isItalicTag($node->getTagName()))
310 $font[static::FONT_ITALIC] =
true;
312 if(!isset($font[static::FONT_UNDERLINED]) && $this->
isUnderlinedTag($node->getTagName()))
314 $font[static::FONT_UNDERLINED] =
true;
318 $font[static::FONT_DELETED] =
true;
323 $result[static::DISPLAY] = $display;