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
+21Lines changed: 21 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,6 +84,7 @@ Any of these plugins can be customized by passing options described below.
84
84
|**delimiters**| Delimiters used for html-escaped expressions |`['{{', '}}']`|
85
85
|**unescapeDelimiters**| Delimiters used for unescaped expressions |`['{{{', '}}}']`|
86
86
|**markdown**| Options passed in to [markdown-it](https://github.com/markdown-it/markdown-it) constructor |`{ typographer: true, linkify: true }`|
87
+
|**markdownPlugins**| Plugins to be loaded by [markdown-it](https://github.com/markdown-it/markdown-it) parser. See below for more details. ||
87
88
|**content**| Options passed to the [reshape-content](https://github.com/reshape/content) plugin |`{ md: renderMarkdown, mdi: renderMarkdownInline }`|
88
89
|**parser**| custom html parser if desired. pass `false` to use the default html parser |`sugarml`|
89
90
|**retext**| Plugins to be passed to the [reshape-retext](https://github.com/reshape/retext) plugin |`[smartypants]` ([ref](https://github.com/wooorm/retext-smartypants)) |
@@ -129,6 +130,26 @@ Would render without additional paragraph wrappings or unexpected title renders:
129
130
<p> Hello, I am #1 and this is <a href='#'>my link</a>.
130
131
```
131
132
133
+
### Markdown Plugins
134
+
135
+
You can pass an array of [markdown-it plugins](https://www.npmjs.com/browse/keyword/markdown-it-plugin) via the `markdownPlugins` option with or without their own options.
136
+
137
+
```js
138
+
constreshape=require('reshape')
139
+
conststandard=require('reshape-standard')
140
+
constemoji=require('markdown-it-emoji')
141
+
constanchor=require('markdown-it-anchor')
142
+
consttoc=require('markdown-it-table-of-contents')
143
+
144
+
reshape(standard(markdownPlugins: [
145
+
emoji,
146
+
anchor,
147
+
[toc, { containerClass:'toc' }]
148
+
]))
149
+
.process(someHtml)
150
+
.then((res) =>console.log(res.output()))
151
+
```
152
+
132
153
### License & Contributing
133
154
134
155
- Details on the license [can be found here](LICENSE.md)
0 commit comments