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

Fix text style combinations rendering #87

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

saraoswald
Copy link

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:

<w:r>
  <w:rPr>
    <w:i/>
  </w:rPr>
  <w:rPr>
    <w:b/>
  </w:rPr>
  <w:t xml:space="preserve">some text</w:t>
</w:r>

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.

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

Successfully merging this pull request may close these issues.

1 participant