From a2377e1129331430998de821ed3abf38247edca1 Mon Sep 17 00:00:00 2001 From: Mike Dirolf Date: Sat, 14 Jan 2012 13:10:44 -0500 Subject: When safe mode is 'escape', don't allow bad html to stop further processing. See tests/html4_safe/html_then_blockquote.(txt|html). It looks like having unclosed block-level html elements was causing further processing not to happen, even in the case where we're escaping HTML. Since we're escaping HTML, it seems like it shouldn't affect processing at all. This changes output results in a couple of other tests, but the new output seems reasonable to me. --- markdown/preprocessors.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'markdown/preprocessors.py') diff --git a/markdown/preprocessors.py b/markdown/preprocessors.py index 0094d7b..c0f0034 100644 --- a/markdown/preprocessors.py +++ b/markdown/preprocessors.py @@ -14,7 +14,8 @@ import odict def build_preprocessors(md_instance, **kwargs): """ Build the default set of preprocessors used by Markdown. """ preprocessors = odict.OrderedDict() - preprocessors["html_block"] = HtmlBlockPreprocessor(md_instance) + if md_instance.safeMode != 'escape': + preprocessors["html_block"] = HtmlBlockPreprocessor(md_instance) preprocessors["reference"] = ReferencePreprocessor(md_instance) return preprocessors -- cgit v1.2.3