From aa78a8996d960dd604f48cfcbc44d67444053346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AB=E5=85=8B=E7=99=BD?= Date: Sat, 13 Jul 2013 23:24:56 +0800 Subject: [PATCH] a bug about options Ensure it can traverse the extensions list --- src/showdown.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/showdown.js b/src/showdown.js index a2ca4c7..5b5c4e0 100644 --- a/src/showdown.js +++ b/src/showdown.js @@ -219,11 +219,13 @@ 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]; - } + var extensionList = converter_options.extensions; + + // if a string is given like this new Showdown.converter({ extensions: 'github' }) + // Ensure it can traverse the extensions list + if(typeof extensionList === 'string'){ + converter_options.extensions = [extensionList]; + } // Iterate over each plugin Showdown.forEach(converter_options.extensions, function(plugin){