Hello,
Thanks for sharing a sample that illustrates your issue. Then the issue is not related to addLink styles but when creating and applying a custom character style.
When applying doubleStrikeThrough and strikeThrough options to a custom style, they are checked internally using isset (other styles such as bold and italic check boolean values). To prevent adding doubleStrikeThrough and strikeThrough when adding a custom style, please avoid setting them with any value.
If you want to get the same behaviour as using bold and italic styles with styleThrough and doubleStrikeThrough styles in custom styles (true/false values), please edit CreateParagraphStyle.php (Classes/Phpdocx/Elements folder in the namespaces package) and change the generateBooleanTrueProp method with the following content:
private function generateBooleanTrueProp($tag)
{
if ($this->style[$tag] == 'on' || $this->style[$tag]) {
// normalize the tag names
if ($tag == 'doubleStrikeThrough') {
$tag = 'dstrike';
} else if ($tag == 'strikeThrough') {
$tag = 'strike';
}
return '<w:' . $tag . '/>';
}
}
The same change has been applied to current testing branch of phpdocx.
Regards.