HTML Reader : Set style name from the CSS class (and if not CSS is loaded)

This commit is contained in:
Progi1984 2022-11-23 13:32:03 +01:00
parent 02a92c8924
commit d721b5eda7

View File

@ -160,8 +160,10 @@ class Html
}
$attributeClass = $attributes->getNamedItem('class');
if ($attributeClass && self::$css) {
$styles = self::parseStyleDeclarations(self::$css->getStyle('.' . $attributeClass->value), $styles);
if ($attributeClass) {
if (self::$css) {
$styles = self::parseStyleDeclarations(self::$css->getStyle('.' . $attributeClass->value), $styles);
}
$styles['className'] = $attributeClass->value;
}