aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaylan Limberg <waylan.limberg@icloud.com>2014-10-18 20:34:33 -0400
committerWaylan Limberg <waylan.limberg@icloud.com>2014-10-18 20:34:33 -0400
commit5e46c060e99cacd634fd722aaf389fbe449aaa30 (patch)
tree366d1bab4288782cc6d90ec4421973f223225b70
parent57633f1743cc16e16c140cc92f860c62d872b6cc (diff)
parent72c819a6c7e10836f9ff67f662ac183fd01f5873 (diff)
downloadmarkdown-5e46c060e99cacd634fd722aaf389fbe449aaa30.tar.gz
markdown-5e46c060e99cacd634fd722aaf389fbe449aaa30.tar.bz2
markdown-5e46c060e99cacd634fd722aaf389fbe449aaa30.zip
Merge pull request #358 from facelessuser/master
Fix tail out of order issue
-rw-r--r--markdown/treeprocessors.py2
-rw-r--r--tests/misc/nested-patterns.html3
-rw-r--r--tests/misc/nested-patterns.txt2
3 files changed, 5 insertions, 2 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
diff --git a/tests/misc/nested-patterns.html b/tests/misc/nested-patterns.html
index 1ac98ee..8c46a58 100644
--- a/tests/misc/nested-patterns.html
+++ b/tests/misc/nested-patterns.html
@@ -4,4 +4,5 @@
<strong><a href="http://example.com"><em>link</em></a></strong>
<strong><a href="http://example.com"><em>link</em></a></strong>
<strong><a href="http://example.com"><em>link</em></a></strong>
-<a href="http://example.com"><strong><em>link</em></strong></a></p> \ No newline at end of file
+<a href="http://example.com"><strong><em>link</em></strong></a></p>
+<p><strong><em>I am <strong><em>italic</em> and</strong> bold</em> I am <code>just</code> bold</strong></p> \ No newline at end of file
diff --git a/tests/misc/nested-patterns.txt b/tests/misc/nested-patterns.txt
index c651b86..e347ccf 100644
--- a/tests/misc/nested-patterns.txt
+++ b/tests/misc/nested-patterns.txt
@@ -5,3 +5,5 @@ __[_link_](http://example.com)__
__[*link*](http://example.com)__
**[_link_](http://example.com)**
[***link***](http://example.com)
+
+***I am ___italic_ and__ bold* I am `just` bold**