Skip to content

Commit

Permalink
Reuse an instance of MarkdownIt in an instance of DocBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
okuryu committed Mar 4, 2015
1 parent d63a0df commit 59e05a8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ YUI.add('doc-builder', function (Y) {
if (options.themedir) {
themeDir = options.themedir;
}

this.md = new MarkdownIt(options.markdown);
this.data = data;
Y.log('Building..', 'info', 'builder');
this.files = 0;
Expand Down Expand Up @@ -142,8 +142,7 @@ YUI.add('doc-builder', function (Y) {
* @return {HTML} The rendered HTML
*/
markdown: function (data) {
var md = new MarkdownIt(this.options.markdown);
var html = md.render(data);
var html = this.md.render(data);
//Only reprocess if helpers were asked for
if (this.options.helpers || (html.indexOf('{{#crossLink') > -1)) {
try {
Expand Down

0 comments on commit 59e05a8

Please sign in to comment.