Explorar el Código

fix(extensions): support for old extension loading mechanism

Estevão Soares dos Santos hace 10 años
padre
commit
95ed7c682e
Se han modificado 5 ficheros con 18 adiciones y 2 borrados
  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) {
 

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 0 - 0
dist/showdown.js.map


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 1 - 1
dist/showdown.min.js


La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 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) {
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio