Skip to content

Fix text style combinations rendering#87

Open
saraoswald wants to merge 1 commit intokarnov:masterfrom
saraoswald:sl/fix-style-combos
Open

Fix text style combinations rendering#87
saraoswald wants to merge 1 commit intokarnov:masterfrom
saraoswald:sl/fix-style-combos

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