You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `<Markdown>` object takes the following common props:
48
48
49
-
| Property | Required | Description
50
-
| --- | --- | ---
51
-
| `children` | `true` | The markdown string to render
52
-
| `style` | `false` | An object to override the styling for the various rules, [see style section below](#style) for full list
53
-
| `mergeStyle` | `false` | if true, when a style is supplied, the individual items are merged with the default styles instead of overwriting them
54
-
| `rules` | `false` | An object of rules that specify how to render each markdown item, [see rules section below](#rules) for full list
55
-
| `onLinkPress` | `false` | A handler function to change click behaviour, [see handling links section below](#handling-links) for more info
56
-
| `debugPrintTree` | `false` | Will print the AST tree to the console to help you see what the markdown is being translated to
49
+
| Property | Default | Required | Description
50
+
| --- | --- | --- | ---
51
+
| `children` | N/A | `true` | The markdown string to render
52
+
| `style` | [source](https://github.com/iamacup/react-native-markdown-display/blob/master/src/lib/styles.js) | `false` | An object to override the styling for the various rules, [see style section below](#style) for full list
53
+
| `mergeStyle` | `true` | `false` | if true, when a style is supplied, the individual items are merged with the default styles instead of overwriting them
54
+
| `rules` | [source](https://github.com/iamacup/react-native-markdown-display/blob/master/src/lib/renderRules.js) | `false` | An object of rules that specify how to render each markdown item, [see rules section below](#rules) for full list
55
+
| `onLinkPress` | `import { Linking } from 'react-native';` and `Linking.openURL(url);` | `false` | A handler function to change click behaviour, [see handling links section below](#handling-links) for more info
56
+
| `debugPrintTree` | `false` | `false` | Will print the AST tree to the console to help you see what the markdown is being translated to
57
57
58
58
59
59
And some additional, less used options:
60
60
61
-
| Property | Required | Description
62
-
| --- | --- | ---
63
-
| `renderer` | `false` | Used to specify a custom renderer, you can not use the rules or styles props with a custom renderer.
64
-
| `markdownit` | `false` | A custom markdownit instance with your configuration, default is `MarkdownIt({typographer: true})`
65
-
| `maxTopLevelChildren` | `false` | Defaults to null, if defined as a number will only render out first `n` many top level children, then will try to render out `topLevelMaxExceededItem`
66
-
| `topLevelMaxExceededItem` | `false` | Defaults to `<Text>...</Text>`- will render when `maxTopLevelChildren` is hit. Make sure to give it a key!
67
-
| `allowedImageHandlers` | `false` | Defaults to `['data:image/png;base64', 'data:image/gif;base64', 'data:image/jpeg;base64', 'https://', 'http://']`- Any image that does not start with one of these will have the `defaultImageHandler` value prepended to it (unless `defaultImageHandler` is null in which case it won't try to render anything)
68
-
| `defaultImageHandler` | `false` | Defaults to `http://` - will be prepended to an image url if it does not start with something in the `allowedImageHandlers` array, if this is set to null, it won't try to recover but will just not render anything instead.
61
+
| Property | Default | Required | Description
62
+
| --- | --- | --- | ---
63
+
| `renderer` | `instanceOf(AstRenderer)` | `false` | Used to specify a custom renderer, you can not use the rules or styles props with a custom renderer.
64
+
| `markdownit` | `instanceOf(MarkdownIt)` | `false` | A custom markdownit instance with your configuration, default is `MarkdownIt({typographer: true})`
65
+
| `maxTopLevelChildren` | `null` | `false` | If defined as a number will only render out first `n` many top level children, then will try to render out `topLevelMaxExceededItem`
66
+
| `topLevelMaxExceededItem` | `<Text key="dotdotdot">...</Text>`| `false` | Will render when `maxTopLevelChildren` is hit. Make sure to give it a key!
67
+
| `allowedImageHandlers` | `['data:image/png;base64', 'data:image/gif;base64', 'data:image/jpeg;base64', 'https://', 'http://']`| `false` | Any image that does not start with one of these will have the `defaultImageHandler` value prepended to it (unless `defaultImageHandler` is null in which case it won't try to render anything)
68
+
| `defaultImageHandler` | `http://` | `false` | Will be prepended to an image url if it does not start with something in the `allowedImageHandlers` array, if this is set to null, it won't try to recover but will just not render anything instead.
0 commit comments