-
-
Notifications
You must be signed in to change notification settings - Fork 27
Description
Is your feature request related to a problem? Please describe.
I'm always frustrated when I try to style code blocks and inline code in Markdown with a monospace font (e.g., Menlo on iOS), but the fontFamily style is not reliably applied. Even though I pass the correct fontFamily in the styles prop, code blocks and inline code do not always render with the expected monospace font in React Native.
Describe the solution you'd like
I would like react-native-marked to guarantee that the fontFamily style provided in the styles.code and styles.codespan props is always applied to the underlying <Text> component for both code blocks and inline code. This should work consistently across platforms, so that developers can use system or custom monospace fonts as intended.
Describe alternatives you've considered
- I verified that using
<Text style={{fontFamily: 'Menlo'}}>test</Text>works as expected in my app, so the issue is not with my environment or font availability. - I tried customizing the
stylesprop and using different font names, but the Markdown code blocks still do not render with the correct font. - I considered using a custom renderer, but this is more complex and should not be necessary for such a common use case.
Additional context
This is a common requirement for displaying code in chat apps, documentation, and developer tools. Other Markdown libraries for React Native (and web) allow reliable monospace font styling for code.
Screenshots and code samples can be provided if needed.