Skip to content

Android: em.color is overwritten by paragraph TextSpan color #416

Description

@BatiSlyme

Greetings, I found the following problem while trying to style the :

Describe the bug
em.color works on iOS but does not render on Android in EnrichedMarkdownText.

To Reproduce
Steps to reproduce the behavior:

<EnrichedMarkdownText
  markdown="_Stand: Februar 2026_"
  flavor="github"
  markdownStyle={{
    paragraph: {
      color: "#1F1F21",
      fontSize: 14,
      lineHeight: 19,
    },
    em: {
      color: "#58585C",
      fontStyle: "normal",
    },
  }}
/>

Expected behavior
Android renders the text with the em color (#58585C).

Actual
iOS renders the em.color correctly.
Android renders the text with the paragraph color (#1F1F21) instead of (#58585C).

Device (please complete the following information):

  • Device: Pixel_9a
  • OS: Android
  • Version 36.1
  • react-native-enriched-markdown: 0.6.0

Additional context
Suspected Cause
On Android, EmphasisSpan appears to apply the emphasis color, but TextSpan later resets the paint color to the block color:

tp.color = blockStyle.color
This likely overwrites inline styles like em.color.

  • A possible fix might be for TextSpan to preserve inline colors, similar to:

tp.applyColorPreserving(blockStyle.color, *styleCache.colorsToPreserve)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions