Skip to content

Commit 5e46c06

Browse files
committed
Merge pull request #358 from facelessuser/master
Fix tail out of order issue
2 parents 57633f1 + 72c819a commit 5e46c06

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

markdown/treeprocessors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def __processElementText(self, node, subnode, isText=True):
132132
childResult = self.__processPlaceholders(text, subnode, isText)
133133

134134
if not isText and node is not subnode:
135-
pos = list(node).index(subnode)
135+
pos = list(node).index(subnode) + 1
136136
else:
137137
pos = 0
138138

tests/misc/nested-patterns.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
<strong><a href="http://example.com"><em>link</em></a></strong>
55
<strong><a href="http://example.com"><em>link</em></a></strong>
66
<strong><a href="http://example.com"><em>link</em></a></strong>
7-
<a href="http://example.com"><strong><em>link</em></strong></a></p>
7+
<a href="http://example.com"><strong><em>link</em></strong></a></p>
8+
<p><strong><em>I am <strong><em>italic</em> and</strong> bold</em> I am <code>just</code> bold</strong></p>

tests/misc/nested-patterns.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ __[_link_](http://example.com)__
55
__[*link*](http://example.com)__
66
**[_link_](http://example.com)**
77
[***link***](http://example.com)
8+
9+
***I am ___italic_ and__ bold* I am `just` bold**

0 commit comments

Comments
 (0)