mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
fix(showdown): fix for options merging into globalOptions
Passing an option to a specific converter affects other instances of the converter since options are merged into showdown's global options. This commit fixes that. Closes #153
This commit is contained in:
parent
a4e67a0ee7
commit
ddd6011df2
BIN
dist/showdown.js
vendored
BIN
dist/showdown.js
vendored
Binary file not shown.
BIN
dist/showdown.js.map
vendored
BIN
dist/showdown.js.map
vendored
Binary file not shown.
BIN
dist/showdown.min.js
vendored
BIN
dist/showdown.min.js
vendored
Binary file not shown.
BIN
dist/showdown.min.js.map
vendored
BIN
dist/showdown.min.js.map
vendored
Binary file not shown.
|
@ -131,7 +131,7 @@ showdown.Converter = function (converterOptions) {
|
|||
|
||||
converterOptions = converterOptions || {};
|
||||
|
||||
var options = globalOptions,
|
||||
var options = {},
|
||||
langExtensions = [],
|
||||
outputModifiers = [],
|
||||
parserOrder = [
|
||||
|
@ -142,6 +142,12 @@ showdown.Converter = function (converterOptions) {
|
|||
'unescapeSpecialChars'
|
||||
];
|
||||
|
||||
for (var gOpt in globalOptions) {
|
||||
if (globalOptions.hasOwnProperty(gOpt)) {
|
||||
options[gOpt] = globalOptions[gOpt];
|
||||
}
|
||||
}
|
||||
|
||||
// Merge options
|
||||
if (typeof converterOptions === 'object') {
|
||||
for (var opt in converterOptions) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user