فهرست منبع

fix(output modifiers): fix for output modifiers running twice

Output modifiers were being ran twice. This commit fixes that
Estevao Soares dos Santos 10 سال پیش
والد
کامیت
dcbdc61e9d
2فایلهای تغییر یافته به همراه20 افزوده شده و 0 حذف شده
  1. 0 0
      dist/showdown.js.map
  2. 20 0
      test/node/showdown.Converter.makeHtml.js

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 0 - 0
dist/showdown.js.map


+ 20 - 0
test/node/showdown.Converter.makeHtml.js

@@ -17,6 +17,26 @@ describe('showdown.Converter', function () {
       .filter(filter())
       .map(map('test/issues/'));
 
+  describe('Converter.options extensions', function () {
+    showdown.extensions.testext = function () {
+      return [{
+        type: 'output',
+        filter: function (text) {
+          runCount = runCount + 1;
+          return text;
+        }
+      }];
+    };
+    var runCount,
+        converter = new showdown.Converter({extensions: ['testext']});
+
+    it('output extensions should run once', function () {
+      runCount = 0;
+      converter.makeHtml('# testext');
+      runCount.should.equal(1);
+    });
+  });
+
   function filter() {
     return function (file) {
       var ext = file.slice(-3);

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است