a bug about options

Ensure it can traverse the extensions list
This commit is contained in:
八克白 2013-07-13 23:20:03 +08:00
parent 2e102c72b2
commit c579d08c9a

View File

@ -218,6 +218,12 @@ this.makeHtml = function(text) {
if (converter_options && converter_options.extensions) {
var self = this;
// if a string is given like this new Showdown.converter({ extensions: 'github' })
// Ensure it can traverse the extensions list
if(typeof converter_options.extensions === 'string'){
converter_options.extensions = [converter_options.extensions];
}
// Iterate over each plugin
Showdown.forEach(converter_options.extensions, function(plugin){