浏览代码

fix(extensions): support for old extension loading mechanism

Estevão Soares dos Santos 10 年之前
父节点
当前提交
95ed7c682e
共有 5 个文件被更改,包括 18 次插入2 次删除
  1. 9 1
      dist/showdown.js
  2. 0 0
      dist/showdown.js.map
  3. 1 1
      dist/showdown.min.js
  4. 0 0
      dist/showdown.min.js.map
  5. 8 0
      src/showdown.js

+ 9 - 1
dist/showdown.js

@@ -1,4 +1,4 @@
-;/*! showdown 22-04-2015 */
+;/*! showdown 23-04-2015 */
 (function(){
 /**
  * Created by Tivie on 06-01-2015.
@@ -153,6 +153,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) {
 

文件差异内容过多而无法显示
+ 0 - 0
dist/showdown.js.map


文件差异内容过多而无法显示
+ 1 - 1
dist/showdown.min.js


文件差异内容过多而无法显示
+ 0 - 0
dist/showdown.min.js.map


+ 8 - 0
src/showdown.js

@@ -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) {
 

部分文件因为文件数量过多而无法显示