react-native-markdown-renderer
react-native-markdown-renderer copied to clipboard
LineHeight Style Prop not working
I try to give the Markdown text lineHeight styling, but somehow it just ignores it. This is what I tried:
const styles = {
text: {
fontFamily: "Avenir",
color: "#444",
fontSize: 17,
lineHeight: 24
}
};
I too am seeing a similar occurrence.
Any progress on this one?
Have you tried any other properties? Maybe paragraph? See for example: https://github.com/mientjan/react-native-markdown-renderer/blob/master/src/lib/styles.js#L81 they set line height for the listUnorderedItemIcon based on platform.
Have you tried any other properties? Maybe
paragraph? See for example: https://github.com/mientjan/react-native-markdown-renderer/blob/master/src/lib/styles.js#L81 they set line height for thelistUnorderedItemIconbased on platform.
This does not work, because lineHeight is not an allowed style attribute for View.
I created a pull request to fix the issue #85
in the meantime you can supply a custom styling rule to get the result you want:
text: (node, children, parent, styles) => (
<Text key={node.key} style={myMarkdownStyles.text}>
{node.content}
</Text>
),