Skip to content

Commit caae2cd

Browse files
committed
Adjust markdown styles
1 parent 5553e79 commit caae2cd

File tree

1 file changed

+30
-2
lines changed

1 file changed

+30
-2
lines changed

src/AiResponse.tsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
Image,
77
Linking,
88
Pressable,
9+
StyleSheet,
910
Text,
1011
View,
1112
} from 'react-native';
@@ -74,10 +75,37 @@ function AiTextResponse({text}: AiTextResponseProps): JSX.Element {
7475
content={node.content}/>
7576
)
7677
},
77-
}
78+
}
79+
80+
const styles = StyleSheet.create({
81+
listItem: {
82+
// Removing these because they break the rendering of list items
83+
// flex: 1,
84+
// flexWrap: 'wrap',
85+
},
86+
paragraph: {
87+
marginTop: 0, // Removing the 10px here because they are being applied to list items too
88+
marginBottom: 0, // Removing the 10px here because they are being applied to list items too
89+
flexWrap: 'wrap',
90+
flexDirection: 'row',
91+
alignItems: 'flex-start',
92+
justifyContent: 'flex-start',
93+
},
94+
listUnorderedItemIcon: {
95+
marginLeft: 10,
96+
marginRight: 10,
97+
lineHeight: 20, // This is Platform.selected only on IOS/Android in https://github.com/mientjan/react-native-markdown-renderer/blob/master/src/lib/styles.js
98+
},
99+
listOrderedItemIcon: {
100+
marginLeft: 10,
101+
marginRight: 10,
102+
lineHeight: 30, // This is Platform.selected only on IOS/Android in https://github.com/mientjan/react-native-markdown-renderer/blob/master/src/lib/styles.js
103+
},
104+
105+
});
78106

79107
return (
80-
<Markdown rules={rules}>{text || ""}</Markdown>
108+
<Markdown rules={rules} style={styles}>{text}</Markdown>
81109
);
82110
}
83111

0 commit comments

Comments
 (0)