From 6e1102386c163d715aeee991575b0953829cbda5 Mon Sep 17 00:00:00 2001 From: Jesse Stuart Date: Tue, 7 May 2013 20:05:40 -0400 Subject: [PATCH] Fix: never render or html tags If a preprocessor needs to remove a tag, this patch allows it to do so by making the tag null or undefined. --- lib/markdown.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/markdown.js b/lib/markdown.js index 75ce6501..4e68714c 100644 --- a/lib/markdown.js +++ b/lib/markdown.js @@ -1452,6 +1452,11 @@ function render_tree( jsonml ) { content.push( render_tree( jsonml.shift() ) ); } + // edge case where tag has been removed at some point (e.g. preprocessTreeNode) + if ( !tag ) { + return content + } + var tag_attrs = ""; for ( var a in attributes ) { tag_attrs += " " + a + '="' + escapeHTML( attributes[ a ] ) + '"';