aboutsummaryrefslogtreecommitdiffstats
path: root/markdown/treeprocessors.py
diff options
context:
space:
mode:
authorfacelessuser <faceless.shop@gmail.com>2014-10-18 13:17:53 -0600
committerfacelessuser <faceless.shop@gmail.com>2014-10-18 13:17:53 -0600
commit72c819a6c7e10836f9ff67f662ac183fd01f5873 (patch)
tree366d1bab4288782cc6d90ec4421973f223225b70 /markdown/treeprocessors.py
parent57633f1743cc16e16c140cc92f860c62d872b6cc (diff)
downloadmarkdown-72c819a6c7e10836f9ff67f662ac183fd01f5873.tar.gz
markdown-72c819a6c7e10836f9ff67f662ac183fd01f5873.tar.bz2
markdown-72c819a6c7e10836f9ff67f662ac183fd01f5873.zip
Fix tail out of order issue
This issue was discovered when dealing with nested inlines. In treeprocessors.py it was incorrectly handling tails. In short, tail elements were being inserted earlier than they were supposed to be. In order to fix this, the insertion index should be incremented by 1 so that when the tails are inserted into the parent, they will be just after the child they came from. Also added a test in nested-patterns to catch this issue.
Diffstat (limited to 'markdown/treeprocessors.py')
-rw-r--r--markdown/treeprocessors.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/markdown/treeprocessors.py b/markdown/treeprocessors.py
index d3ee207..303e460 100644
--- a/markdown/treeprocessors.py
+++ b/markdown/treeprocessors.py
@@ -132,7 +132,7 @@ class InlineProcessor(Treeprocessor):
childResult = self.__processPlaceholders(text, subnode, isText)
if not isText and node is not subnode:
- pos = list(node).index(subnode)
+ pos = list(node).index(subnode) + 1
else:
pos = 0