fix(extensions): support for old extension loading mechanism

This commit is contained in:
Estevão Soares dos Santos 2015-04-23 00:15:54 +01:00
parent 7deea25a5e
commit 95ed7c682e
5 changed files with 8 additions and 0 deletions

BIN
dist/showdown.js vendored

Binary file not shown.

BIN
dist/showdown.js.map vendored

Binary file not shown.

BIN
dist/showdown.min.js vendored

Binary file not shown.

Binary file not shown.

View File

@ -151,6 +151,14 @@ showdown.Converter = function (converterOptions) {
}
}
// This is a dirty workaround to maintain backwards extension compatibility
// We define a self var (which is a copy of this) and inject the makeHtml function
// directly to it. This ensures a full converter object is available when iterating over extensions
// We should rewrite the extension loading mechanism and use some kind of interface or decorator pattern
// and inject the object reference there instead.
var self = this;
self.makeHtml = makeHtml;
// Parse options
if (options.extensions) {