iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix paragraph base margin

CHNB128 opened this issue Β· comments

Hi! πŸ‘‹

Firstly, thanks for your work on this project! πŸ™‚

I find out, that there is problem with margin when you have some headings without content direct after it, like...

#Headgin 1
## Heading 2 

paragraph here 

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-markdown-display/src/lib/styles.js b/node_modules/react-native-markdown-display/src/lib/styles.js
index e1b5e39..1eecdd6 100644
--- a/node_modules/react-native-markdown-display/src/lib/styles.js
+++ b/node_modules/react-native-markdown-display/src/lib/styles.js
@@ -13,22 +13,27 @@ export const styles = {
   heading2: {
     flexDirection: 'row',
     fontSize: 24,
+    marginTop: 10,
   },
   heading3: {
     flexDirection: 'row',
     fontSize: 18,
+    marginTop: 10,
   },
   heading4: {
     flexDirection: 'row',
     fontSize: 16,
+    marginTop: 10,
   },
   heading5: {
     flexDirection: 'row',
     fontSize: 13,
+    marginTop: 10,
   },
   heading6: {
     flexDirection: 'row',
     fontSize: 11,
+    marginTop: 10,
   },
 
   // Horizontal Rule
@@ -172,7 +177,6 @@ export const styles = {
   textgroup: {},
   paragraph: {
     marginTop: 10,
-    marginBottom: 10,
     flexWrap: 'wrap',
     flexDirection: 'row',
     alignItems: 'flex-start',

This issue body was partially generated by patch-package.