Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed underlining when no explicit foreground color is set #37

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

andalman
Copy link
Contributor

The color argument to underlineElement is now optional, since the OOXML <w:u> element doesn't require it. If the underlineColor NSAttributedString.Key is set, that will be passed. Otherwise, when nil is passed, no color will be explicitly set. Happily, in that case, Word just uses the text color anyways.

Made `color` optional when creating an underline element. In addition, if the `underlineColor` attribute is present, it will be preferred over `foregroundColor` (if any). If neither is specified, the underline color will not be output explicitly.
… an underline

When no underline color is explicitly specified on the <w:u> element, Word already falls back to the text color. So, there’s no reason for DocX to perform this check as well.
@shinjukunian shinjukunian merged commit 0b722d3 into shinjukunian:master Jan 27, 2023
@shinjukunian
Copy link
Owner

Thank you fro your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants