Skip to content

markdownTypography.textLink is always rendered in bold, even when explicitly setting fontWeight = FontWeight.Normal #514

@abhishekt134

Description

@abhishekt134

Bug Description

markdownTypography.textLink is always rendered in bold, even when explicitly setting fontWeight = FontWeight.Normal or FontWeight.Light. The provided TextLinkStyles.style (SpanStyle) is being ignored for font weight. Color changes apply correctly, but font weight does not.

This happens even when defining the SpanStyle from scratch (not copying from a bold base style).

Steps to Reproduce

Configure Markdown with custom typography:

Markdown(
    content = "[Test Link](https://example.com)",
    typography = MarkdownTypography(
        text = bodyStyle,
        textLink = TextLinkStyles(
            style = bodyStyle.copy(
                color = DesignKitTheme.colors.primary,
                fontWeight = FontWeight.Normal,
                textDecoration = TextDecoration.None
            ).toSpanStyle()
        )
    )
)

Run on Android.

Observe that the link text is rendered bold despite fontWeight = FontWeight.Normal.

Expected Behavior

textLink should respect the provided SpanStyle, including fontWeight.If FontWeight.Normal or FontWeight.Light is provided, the link should render using that weight instead of bold.

Screenshots

Image

Environment

  • Library Version: [0.39.2]
  • Platform: [Android]
  • Device: [Pixel 9]
  • OS Version: [Android 16]

Additional Context

The issue persists even when:

  • Using SpanStyle(fontWeight = FontWeight.Normal) directly (without copying base style).
  • Ensuring the FontFamily contains multiple weights (Normal, Light, SemiBold).
  • Removing any ProvideTextStyle wrappers.

The issue appears specific to link rendering only.
It may be caused by internal merging logic overriding the provided fontWeight.

Checklist

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions