diff --git a/lib/marked.js b/lib/marked.js index b56ad176e7..4399d3f7d1 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1345,25 +1345,29 @@ marked.setOptions = function(opt) { return marked; }; -marked.defaults = { - baseUrl: null, - breaks: false, - gfm: true, - headerIds: true, - headerPrefix: '', - highlight: null, - langPrefix: 'lang-', - mangle: true, - pedantic: false, - renderer: new Renderer(), - sanitize: false, - sanitizer: null, - silent: false, - smartLists: false, - smartypants: false, - tables: true, - xhtml: false -}; +marked.getDefaults = function () { + return { + baseUrl: null, + breaks: false, + gfm: true, + headerIds: true, + headerPrefix: '', + highlight: null, + langPrefix: 'lang-', + mangle: true, + pedantic: false, + renderer: new Renderer(), + sanitize: false, + sanitizer: null, + silent: false, + smartLists: false, + smartypants: false, + tables: true, + xhtml: false + }; +} + +marked.defaults = marked.getDefaults(); /** * Expose diff --git a/test/helpers/helpers.js b/test/helpers/helpers.js new file mode 100644 index 0000000000..d9244a880b --- /dev/null +++ b/test/helpers/helpers.js @@ -0,0 +1,5 @@ +var marked = require('../../lib/marked.js'); + +beforeEach(function () { + marked.setOptions(marked.getDefaults()); +});