From b460572ccbcf4f275d38490e47c5d2cb6a42b1e9 Mon Sep 17 00:00:00 2001 From: Xavier Damman Date: Tue, 10 Dec 2013 00:20:00 -0800 Subject: [PATCH] Making sure we only load extension files that end with .js. Otherwise, it creates issues with vim that adds a .js.swp while editing --- src/showdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/showdown.js b/src/showdown.js index b488bad..f8e394e 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -123,7 +123,7 @@ if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof req if (fs) { // Search extensions folder var extensions = fs.readdirSync((__dirname || '.')+'/extensions').filter(function(file){ - return ~file.indexOf('.js'); + return file.match(/\.js$/); }).map(function(file){ return file.replace(/\.js$/, ''); });