mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
feat(Converter.options): add getOption(), setOption() and getOptions() to Converter object
Provides a way to get and set options directly in a Converter object
This commit is contained in:
parent
141e3f5f44
commit
db6f79b08d
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.
|
@ -280,7 +280,36 @@ showdown.Converter = function (converterOptions) {
|
|||
return text;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set an option of this Converter instance
|
||||
* @param {string} key
|
||||
* @param {string} value
|
||||
*/
|
||||
function setOption (key, value) {
|
||||
options[key] = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the option of this Converter instance
|
||||
* @param {string} key
|
||||
* @returns {*}
|
||||
*/
|
||||
function getOption(key) {
|
||||
return options[key];
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the options of this Converter instance
|
||||
* @returns {{}}
|
||||
*/
|
||||
function getOptions() {
|
||||
return options;
|
||||
}
|
||||
|
||||
return {
|
||||
makeHtml: makeHtml
|
||||
makeHtml: makeHtml,
|
||||
setOption: setOption,
|
||||
getOption: getOption,
|
||||
getOptions: getOptions
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user