소스 검색

Merge pull request #148 from ErisDS/plugin-name-bug

Fix extension name in error always 'undefined'. Fixes #141
Estevão Soares dos Santos 10 년 전
부모
커밋
1efa88d90a
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      src/showdown.js

+ 2 - 1
src/showdown.js

@@ -222,6 +222,7 @@ Showdown.converter = function (converter_options) {
 
         // Iterate over each plugin
         Showdown.forEach(converter_options.extensions, function (plugin) {
+            var pluginName = plugin;
 
             // Assume it's a bundled plugin if a string is given
             if (typeof plugin === 'string') {
@@ -244,7 +245,7 @@ Showdown.converter = function (converter_options) {
                     }
                 });
             } else {
-                throw "Extension '" + plugin + "' could not be loaded.  It was either not found or is not a valid extension.";
+                throw "Extension '" + pluginName + "' could not be loaded.  It was either not found or is not a valid extension.";
             }
         });
     }