From e2e837b1ad006494d223b83fdac135ce431ab782 Mon Sep 17 00:00:00 2001 From: Parth Laxmikant Kolekar Date: Thu, 3 Mar 2016 23:43:27 +0530 Subject: [PATCH] Nesting
 in  blocks instead

When I make a markdown message in the form of 4-space indent.

        <4 spaces>test

The output is shown in the form of

        
test
This breaks some tagging in the wikimedia editor which I am using. (Quite an old version.). It interprets the nested code tag as `` Simply inverting this should make it work again. --- markdown/blockprocessors.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/markdown/blockprocessors.py b/markdown/blockprocessors.py index 870151bec..3d7a6ba48 100644 --- a/markdown/blockprocessors.py +++ b/markdown/blockprocessors.py @@ -243,10 +243,10 @@ def run(self, parent, blocks): ) else: # This is a new codeblock. Create the elements and insert text. - pre = util.etree.SubElement(parent, 'pre') - code = util.etree.SubElement(pre, 'code') + code = util.etree.SubElement(parent, 'pre') + pre = util.etree.SubElement(code, 'code') block, theRest = self.detab(block) - code.text = util.AtomicString('%s\n' % block.rstrip()) + pre.text = util.AtomicString('%s\n' % block.rstrip()) if theRest: # This block contained unindented line(s) after the first indented # line. Insert these lines as the first block of the master blocks