File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
src/PhpWord/Writer/HTML/Style
tests/PhpWordTests/Shared Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -73,6 +73,13 @@ public function write()
73
73
} elseif ($ style ->isRTL () === false ) {
74
74
$ css ['direction ' ] = 'ltr ' ;
75
75
}
76
+ $ shading = $ style ->getShading ();
77
+ if ($ shading !== null ) {
78
+ $ fill = $ shading ->getFill ();
79
+ if (!empty ($ fill )) {
80
+ $ css ['background-color ' ] = preg_match ('/^[0-9a-fA-F]{6}$/ ' , $ fill ) ? "# $ fill " : $ fill ;
81
+ }
82
+ }
76
83
77
84
return $ this ->assembleCss ($ css );
78
85
}
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ public function testParseTableBorder0(): void
73
73
self ::assertSame ($ expected , $ count );
74
74
$ substring2 = 'border-top-style: dotted; border-top-color: #FF0000; border-left-style: dotted; border-left-color: #FF0000; border-bottom-style: dotted; border-bottom-color: #FF0000; border-right-style: dotted; border-right-color: #FF0000; ' ;
75
75
self ::assertSame (1 , substr_count ($ content , $ substring2 ));
76
+ self ::assertStringContainsString ('style="background-color: #00FF00;">header c</span> ' , $ content );
76
77
}
77
78
78
79
public function testParseTableStyleBorderNone (): void
You can’t perform that action at this time.
0 commit comments