Explorar o código

Extension autoloading fix

Pavel Lang %!s(int64=13) %!d(string=hai) anos
pai
achega
a67421ba2a
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      src/showdown.js

+ 2 - 2
src/showdown.js

@@ -122,10 +122,10 @@ if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof req
 
 	if (fs) {
 		// Search extensions folder
-		var extensions = fs.readdirSync('./src/extensions').filter(function(file){
+		var extensions = fs.readdirSync((__dirname || '.')+'/extensions').filter(function(file){
 			return ~file.indexOf('.js');
 		}).map(function(file){
-			return file.replace('.js', '');
+			return file.replace(/\.js$/, '');
 		});
 		// Load extensions into Showdown namespace
 		extensions.forEach(function(ext){