221 $result[static::DISPLAY] = static::DISPLAY_HIDDEN;
227 $styles = $node->getStyle();
232 $stylePairs = explode(
';', $styles);
233 foreach($stylePairs as $pair)
235 list($name, $value) = explode(
':', $pair);
239 $value = trim($value);
240 if($name == static::DISPLAY)
244 $display = static::DISPLAY_HIDDEN;
246 elseif($value ==
'block')
248 $display = static::DISPLAY_BLOCK;
250 elseif($value ==
'inline')
252 $display = static::DISPLAY_INLINE;
255 elseif($name ==
'font-weight')
257 if(intval($value) > 500 || $value ==
'bold')
259 $font[static::FONT_BOLD] =
true;
261 elseif(intval($value) < 500 || $value ==
'normal')
263 $font[static::FONT_BOLD] =
false;
266 elseif($name ==
'font-style')
268 if($value ==
'italic' || mb_strpos($value,
'oblique') === 0)
270 $font[static::FONT_ITALIC] =
true;
272 elseif($value ==
'normal')
274 $font[static::FONT_ITALIC] =
false;
277 elseif($name ==
'text-decoration')
279 if(strpos($value,
'underline') !==
false)
281 $font[static::FONT_UNDERLINED] =
true;
283 if(strpos($value,
'line-through') !==
false)
285 $font[static::FONT_DELETED] =
true;
289 $font[static::FONT_UNDERLINED] =
false;
290 $font[static::FONT_DELETED] =
false;
296 if($display == static::DISPLAY_HIDDEN)
298 $result[static::DISPLAY] = $display;
301 if(!$display && $this->
isBlockTag($node->getTagName()))
303 $display = static::DISPLAY_BLOCK;
306 if(!isset($font[static::FONT_BOLD]) && $this->
isBoldTag($node->getTagName()))
308 $font[static::FONT_BOLD] =
true;
310 if(!isset($font[static::FONT_ITALIC]) && $this->
isItalicTag($node->getTagName()))
312 $font[static::FONT_ITALIC] =
true;
314 if(!isset($font[static::FONT_UNDERLINED]) && $this->
isUnderlinedTag($node->getTagName()))
316 $font[static::FONT_UNDERLINED] =
true;
320 $font[static::FONT_DELETED] =
true;
325 $result[static::DISPLAY] = $display;
327 $result[
'font'] = $font;