diff options
author | Waylan Limberg <waylan@gmail.com> | 2010-03-15 20:31:59 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2010-03-15 20:41:26 -0400 |
commit | bdf27a37a8cec16d5c0cc53e8a17e4b1ceacbd50 (patch) | |
tree | 8e33a1f9a567c0ac1838849c24351ad0115bbc05 /markdown/blockprocessors.py | |
parent | 114770b3043bca52a8e3fa4f007012b3b4dff602 (diff) | |
download | markdown-bdf27a37a8cec16d5c0cc53e8a17e4b1ceacbd50.tar.gz markdown-bdf27a37a8cec16d5c0cc53e8a17e4b1ceacbd50.tar.bz2 markdown-bdf27a37a8cec16d5c0cc53e8a17e4b1ceacbd50.zip |
Fixed Ticket 53. Nested lists no longer isorder items in certain edge cases. Thanks for the report and preliminary work Gerry LaMontagne.
Diffstat (limited to 'markdown/blockprocessors.py')
-rw-r--r-- | markdown/blockprocessors.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/markdown/blockprocessors.py b/markdown/blockprocessors.py index 7d3b137..98db90b 100644 --- a/markdown/blockprocessors.py +++ b/markdown/blockprocessors.py @@ -143,8 +143,12 @@ class ListIndentProcessor(BlockProcessor): # Assume the last child li is the parent of this block. if sibling[-1].text: # If the parent li has text, that text needs to be moved to a p - block = '%s\n\n%s' % (sibling[-1].text, block) + # The p must be 'inserted' at beginning of list in the event + # that other children already exist i.e.; a nested sublist. + p = markdown.etree.Element('p') + p.text = sibling[-1].text sibling[-1].text = '' + sibling[-1].insert(0, p) self.parser.parseChunk(sibling[-1], block) else: self.create_item(sibling, block) |