Skip to content

Commit eb0aeb1

Browse files
committed
Make parser.js compatible with showdown >= 1.3.0
Parser reassigns showdown's makeHtml and leaves "this" reference hanging. This binds the converter object to makeHtml method fixing the issue.
1 parent a6deff1 commit eb0aeb1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/parser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ var Parser = function(config) {
88
this.parseMdown = config.parsingFunction;
99
} else {
1010
var converter = new showdown.Converter();
11-
this.parseMdown = converter.makeHtml;
11+
this.parseMdown = converter.makeHtml.bind(converter);
1212
}
1313
}
1414

@@ -120,4 +120,4 @@ Parser.prototype.getTitle = function(mdown){
120120
return match? match[1].trim() : '';
121121
}
122122

123-
module.exports = Parser;
123+
module.exports = Parser;

0 commit comments

Comments
 (0)