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
Copy file name to clipboardExpand all lines: README.md
+217-2Lines changed: 217 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -62,7 +62,6 @@ And some additional, less used options:
62
62
| --- | --- | ---
63
63
| `renderer` | `false` | Used to specify a custom renderer, you can not use the rules or styles props with a custom renderer.
64
64
| `markdownit` | `false` | A custom markdownit instance with your configuration, default is `MarkdownIt({typographer: true})`
65
-
| `plugins` | `false` | An array of plugins to be applied to the markdownit instance
66
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`
67
66
| `topLevelMaxExceededItem` | `false` | Defaults to `<Text>...</Text>` - will render when `maxTopLevelChildren` is hit. Make sure to give it a key!
68
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)
@@ -322,7 +321,223 @@ And some additional, less used options:
322
321
<details><summary>Plugins and Extensions</summary>
323
322
<p>
324
323
325
-
Plugins for **extra** syntax support - [see plugins](https://www.npmjs.com/browse/keyword/markdown-it-plugin) for the markdown-it library that this library is built on.
324
+
Plugins for **extra** syntax support can be added using any markdown-it compatible plugins - [see plugins](https://www.npmjs.com/browse/keyword/markdown-it-plugin) for documentation from markdown-it. An example for integration follows:
325
+
326
+
#### Step 1
327
+
328
+
Inspect what the plugin will output - this can be achieved with the following code, using `markdown-it-block-embed` as an example for adding video support:
Identify the new components and integrate the plugin with a rendered compoonent.
382
+
383
+
In the example above, the heading_open, inline and heading_close tags are all handled by the existing code base, but we need to handle the **'video'** type.
384
+
385
+
Note, in the example below we use the `debugPrintTree` property to see what rules we are rendering:
Copy file name to clipboardExpand all lines: package.json
+10-7Lines changed: 10 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "react-native-markdown-display",
3
-
"version": "6.0.1",
3
+
"version": "6.1.0",
4
4
"description": "Markdown renderer for react-native, with CommonMark spec support + adds syntax extensions & sugar (URL autolinking, typographer), originally created by Mient-jan Stelling as react-native-markdown-renderer",
0 commit comments