From d13a57b6c8a78b142149957f25337e7398e290b2 Mon Sep 17 00:00:00 2001 From: szego Date: Tue, 13 Oct 2015 07:35:55 -0300 Subject: [PATCH 1/3] bugfix / checks for disabledElements in inlineLexer Previously the script only checked for the disabledElements option in the Lexer. Now it checks for it in the Lexer and the inlineLexer. --- lib/marked.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/marked.js b/lib/marked.js index fd56e4ed9b..30daebdf6d 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -542,6 +542,10 @@ function InlineLexer(links, options) { } else if (this.options.pedantic) { this.rules = inline.pedantic; } + + for(var i = 0; i < this.options.disabledElements.length; i++) { + this.rules[this.options.disabledElements[i]] = noop; + } } /** From bd17c854778b782b2de4f4cb84ef359f87bd50f5 Mon Sep 17 00:00:00 2001 From: szego Date: Tue, 13 Oct 2015 08:32:35 -0300 Subject: [PATCH 2/3] bugfix / checks for disabledElements in Renderer The script now checks for disabledElements in the Render and disables the appropriate functions. --- lib/marked.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/marked.js b/lib/marked.js index 30daebdf6d..f8d81bc20d 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -766,7 +766,11 @@ InlineLexer.prototype.mangle = function(text) { */ function Renderer(options) { - this.options = options || {}; + this.options = options || {}; + + for(var i = 0; i < this.options.disabledElements.length; i++) { + this[this.options.disabledElements[i]] = noop; + } } Renderer.prototype.code = function(code, lang, escaped) { From a3fe3b91c6947c8f275708b732ad54a81da44d1c Mon Sep 17 00:00:00 2001 From: szego Date: Tue, 13 Oct 2015 08:44:48 -0300 Subject: [PATCH 3/3] Revert "bugfix / checks for disabledElements in Renderer" This reverts commit bd17c854778b782b2de4f4cb84ef359f87bd50f5. --- lib/marked.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/marked.js b/lib/marked.js index f8d81bc20d..30daebdf6d 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -766,11 +766,7 @@ InlineLexer.prototype.mangle = function(text) { */ function Renderer(options) { - this.options = options || {}; - - for(var i = 0; i < this.options.disabledElements.length; i++) { - this[this.options.disabledElements[i]] = noop; - } + this.options = options || {}; } Renderer.prototype.code = function(code, lang, escaped) {