From fa014ac7743836db611713ca630a4919e8d5fa3d Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 22 Aug 2008 23:38:39 -0400 Subject: Fixed Ticket 11. Disabled ``indenteTree`` for `pre` and `code` tags. Now whitespace is preserved in codeblocks. As a side-benefit, this also solved the issue with the safe-mode tests failing. All tests incorectly altered at ElementTree conversion have been corrected for this bug. Any remaining tests that fail are unrelated to this. --- markdown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'markdown.py') diff --git a/markdown.py b/markdown.py index 09cfdea..5d7dc32 100755 --- a/markdown.py +++ b/markdown.py @@ -106,7 +106,7 @@ def indentETree(elem, level=0): else: i = "\n" - if len(elem): + if len(elem) and elem.tag not in ['code', 'pre']: if not elem.text or not elem.text.strip(): elem.text = i + " " for e in elem: -- cgit v1.2.3