Fix text style combinations rendering #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've been using this solution for months and haven't encountered any issues, so I wanted to share 👍
The Issue
Generated documents with multiple text styles applied, e.g.
<b><i>some text</i></b>
, were only being displayed with one of those styles applied when opened in Word (version 16.70).For example, a piece of text that's underlined, bold, and italic would only appear as italic in Word.
The issue occurs when Word renders some text that has this kind of formatting, with separate
<w:rPr>
tags for each style:Word will only display one
<w:rPr>
at a time, so in this case the text would appear to only be italic.The Solution
I added explicit checks within
base.xlst
for each combination of formatting. This results in a singular<w:rPr>
tag for each block of formatted text, as opposed to a separate tag for each style.I also updated the spec files to reflect this change.