From 59e05a8cb256a0cea7d348050373968efa0954da Mon Sep 17 00:00:00 2001 From: Ryuichi Okumura Date: Wed, 4 Mar 2015 21:53:21 +0900 Subject: [PATCH] Reuse an instance of MarkdownIt in an instance of DocBuilder --- lib/builder.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/builder.js b/lib/builder.js index 06b1beb7..aceb2aa7 100644 --- a/lib/builder.js +++ b/lib/builder.js @@ -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; @@ -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 {