mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
feat(showdown.getDefaultOptions): add method to retrieve default global options key->values
Showdown default options are now retrievable through `showdown.getDefaultOptions()` function
This commit is contained in:
parent
27ed758d7b
commit
2de53a7d03
|
@ -52,18 +52,32 @@ showdown.getOption = function (key) {
|
|||
/**
|
||||
* Get the global options
|
||||
* @static
|
||||
* @returns {{omitExtraWLInCodeBlocks: boolean, prefixHeaderId: boolean}}
|
||||
* @returns {{}}
|
||||
*/
|
||||
showdown.getOptions = function () {
|
||||
'use strict';
|
||||
return globalOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Reset global options to the default values
|
||||
* @static
|
||||
*/
|
||||
showdown.resetOptions = function () {
|
||||
'use strict';
|
||||
globalOptions = JSON.parse(JSON.stringify(defaultOptions));
|
||||
};
|
||||
|
||||
/**
|
||||
* Get the default options
|
||||
* @static
|
||||
* @returns {{}}
|
||||
*/
|
||||
showdown.getDefaultOptions = function () {
|
||||
'use strict';
|
||||
return defaultOptions;
|
||||
};
|
||||
|
||||
/**
|
||||
* Get or set a subParser
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user