소스 검색

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

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.