Skip to content

Commit

Permalink
fix(extensions): support for old extension loading mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
tivie committed Apr 22, 2015
1 parent 7deea25 commit 95ed7c6
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 5 deletions.
10 changes: 9 additions & 1 deletion dist/showdown.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/showdown.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/showdown.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/showdown.min.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/showdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand Down

0 comments on commit 95ed7c6

Please sign in to comment.