mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Standardized naming for bundled extensions
This commit is contained in:
parent
5d56cce321
commit
0218913efa
|
@ -228,7 +228,8 @@ if (typeof module !== 'undefind' && typeof exports !== 'undefined' && typeof req
|
|||
});
|
||||
// Load extensions into Showdown namespace
|
||||
extensions.forEach(function(ext){
|
||||
Showdown.extensions[ext] = require('./extensions/' + ext);
|
||||
var name = ext.replace(/[_-]|\\s/g, '').toLowerCase();
|
||||
Showdown.extensions[name] = require('./extensions/' + ext);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ if (path.existsSync('test/extensions')) {
|
|||
}
|
||||
|
||||
// Build converter with extension included
|
||||
var extension = showdown.extensions[ext];
|
||||
var extension = showdown.extensions[ext.replace(/[_-]||\s/g, '').toLowerCase()];
|
||||
if (!extension) {
|
||||
throw "Could not load extension '" + ext + "'. Did you forget module.exports?";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user