Procházet zdrojové kódy

fix(extensions): support for old extension loading mechanism

Estevão Soares dos Santos před 10 roky
rodič
revize
95ed7c682e
5 změnil soubory, kde provedl 18 přidání a 2 odebrání
  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) {
 

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
dist/showdown.js.map


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 1 - 1
dist/showdown.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 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) {
 

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů