Merge pull request #2339 from Progi1984/className

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:47:30 +01:00 committed by GitHub
commit 6041bb3fb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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;
}