diff --git a/src/PhpWord/Shared/Html.php b/src/PhpWord/Shared/Html.php index 7d45b4ba..edd418bf 100644 --- a/src/PhpWord/Shared/Html.php +++ b/src/PhpWord/Shared/Html.php @@ -96,13 +96,13 @@ class Html $attributes = $node->attributes; // get all the attributes(eg: id, class) foreach ($attributes as $attribute) { - $val = trim($attribute->value); + $val = $attribute->value; switch (strtolower($attribute->name)) { case 'style': $styles = self::parseStyle($attribute, $styles); break; case 'align': - $styles['alignment'] = self::mapAlign($val); + $styles['alignment'] = self::mapAlign(trim($val)); break; case 'lang': $styles['lang'] = $val; @@ -121,7 +121,7 @@ class Html break; case 'cellspacing': // tables e.g.