Skip to content

Commit d0b5466

Browse files
author
Kreozot
committed
Parsing function override option.
1 parent 0229290 commit d0b5466

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/js/parser.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@ var showdown = require('showdown');
44
var 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

1115
Parser.prototype.parseDoc = function(mdown){

0 commit comments

Comments
 (0)