-
-
Notifications
You must be signed in to change notification settings - Fork 67
markdownTypography.textLink is always rendered in bold, even when explicitly setting fontWeight = FontWeight.Normal #514
Description
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
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
- I have searched for similar issues
- I have checked the sample application
- I have read the README
- I have checked the CHANGELOG
- I have read the MIGRATION GUIDE