Skip to content

Commit d721b5e

Browse files
committed
HTML Reader : Set style name from the CSS class (and if not CSS is loaded)
1 parent 02a92c8 commit d721b5e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/PhpWord/Shared/Html.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ protected static function parseInlineStyle($node, $styles = [])
160160
}
161161

162162
$attributeClass = $attributes->getNamedItem('class');
163-
if ($attributeClass && self::$css) {
164-
$styles = self::parseStyleDeclarations(self::$css->getStyle('.' . $attributeClass->value), $styles);
163+
if ($attributeClass) {
164+
if (self::$css) {
165+
$styles = self::parseStyleDeclarations(self::$css->getStyle('.' . $attributeClass->value), $styles);
166+
}
165167
$styles['className'] = $attributeClass->value;
166168
}
167169

0 commit comments

Comments
 (0)