File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -212,6 +212,16 @@ Also you can use Handlebars template in your markdown files:
212212Current version: {{ ctx.version }}
213213```
214214
215+ #### Parser override
216+
217+ If you want to use another markdown parser you can override the parsing function:
218+
219+ ``` javascript
220+ parsingFunction : function (markdownText ): {
221+ return myParser .markdownToHtml (markdownText);
222+ }
223+ ```
224+
215225## Examples
216226
217227For a live example check: [ MOUT documentation] ( http://moutjs.com/docs/latest/ )
Original file line number Diff line number Diff line change @@ -4,8 +4,12 @@ var showdown = require('showdown');
44var Parser = function ( config ) {
55 this . config = config ;
66 this . headingLevel = config . headingLevel || 2 ;
7- var converter = new showdown . Converter ( ) ;
8- this . parseMdown = converter . makeHtml ;
7+ if ( config . parsingFunction ) {
8+ this . parseMdown = config . parsingFunction ;
9+ } else {
10+ var converter = new showdown . Converter ( ) ;
11+ this . parseMdown = converter . makeHtml ;
12+ }
913}
1014
1115Parser . prototype . parseDoc = function ( mdown ) {
You can’t perform that action at this time.
0 commit comments