Skip to content

Commit 64b3475

Browse files
committed
🐛 Fix strikethrough XML output for font styles
Word can't have strikethrough and double strikethrough declared and thus ignores both. PHPOffice#2661
1 parent 6072dac commit 64b3475

File tree

1 file changed

+2
-2
lines changed
  • src/PhpWord/Writer/Word2007/Style

1 file changed

+2
-2
lines changed

src/PhpWord/Writer/Word2007/Style/Font.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ private function writeStyle(): void
117117
$xmlWriter->writeElementIf($style->isItalic() !== null, 'w:iCs', 'w:val', $this->writeOnOf($style->isItalic()));
118118

119119
// Strikethrough, double strikethrough
120-
$xmlWriter->writeElementIf($style->isStrikethrough() !== null, 'w:strike', 'w:val', $this->writeOnOf($style->isStrikethrough()));
121-
$xmlWriter->writeElementIf($style->isDoubleStrikethrough() !== null, 'w:dstrike', 'w:val', $this->writeOnOf($style->isDoubleStrikethrough()));
120+
$xmlWriter->writeElementIf($style->isStrikethrough(), 'w:strike', 'w:val', $this->writeOnOf($style->isStrikethrough()));
121+
$xmlWriter->writeElementIf($style->isDoubleStrikethrough(), 'w:dstrike', 'w:val', $this->writeOnOf($style->isDoubleStrikethrough()));
122122

123123
// Small caps, all caps
124124
$xmlWriter->writeElementIf($style->isSmallCaps() !== null, 'w:smallCaps', 'w:val', $this->writeOnOf($style->isSmallCaps()));

0 commit comments

Comments
 (0)