diff options
author | Waylan Limberg <waylan@gmail.com> | 2011-07-21 10:23:16 -0400 |
---|---|---|
committer | Waylan Limberg <waylan@gmail.com> | 2011-07-21 10:23:16 -0400 |
commit | 9927620f789ffc33082e631e532e9ca21eb15fc7 (patch) | |
tree | 959249996492334bc27b261177932678ca4072ab /markdown/treeprocessors.py | |
parent | be3627f5b1f3a7df806a899337a74648edfef76a (diff) | |
download | markdown-9927620f789ffc33082e631e532e9ca21eb15fc7.tar.gz markdown-9927620f789ffc33082e631e532e9ca21eb15fc7.tar.bz2 markdown-9927620f789ffc33082e631e532e9ca21eb15fc7.zip |
Fixed #31. Headers in tight lists now get inline patterns run on their tails. Tests included.
Diffstat (limited to 'markdown/treeprocessors.py')
-rw-r--r-- | markdown/treeprocessors.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py index 4ce8166..3340554 100644 --- a/markdown/treeprocessors.py +++ b/markdown/treeprocessors.py @@ -289,7 +289,18 @@ class InlineProcessor(Treeprocessor): text), child) stack += lst insertQueue.append((child, lst)) - + if child.tail: + tail = self.__handleInline(child.tail) + dumby = util.etree.Element('d') + tailResult = self.__processPlaceholders(tail, dumby) + if dumby.text: + child.tail = dumby.text + else: + child.tail = None + pos = currElement.getchildren().index(child) + 1 + tailResult.reverse() + for newChild in tailResult: + currElement.insert(pos, newChild) if child.getchildren(): stack.append(child) |