mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Extension autoloading fix
This commit is contained in:
parent
483bb8604c
commit
a67421ba2a
@ -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){
|
||||
|
Loading…
x
Reference in New Issue
Block a user