diff --git a/lib/markdown2.py b/lib/markdown2.py index 34a270b3..c0db9874 100755 --- a/lib/markdown2.py +++ b/lib/markdown2.py @@ -1786,7 +1786,8 @@ def _do_links(self, text): curr_pos = start_idx + 1 else: # This id isn't defined, leave the markup alone. - curr_pos = match.end() + # set current pos to end of link title and continue from there + curr_pos = p continue # Otherwise, it isn't markup. diff --git a/test/tm-cases/link_after_square_brackets.html b/test/tm-cases/link_after_square_brackets.html new file mode 100644 index 00000000..a5421f3c --- /dev/null +++ b/test/tm-cases/link_after_square_brackets.html @@ -0,0 +1,3 @@ +

[before] +Some link +[after]

diff --git a/test/tm-cases/link_after_square_brackets.text b/test/tm-cases/link_after_square_brackets.text new file mode 100644 index 00000000..7c569d7b --- /dev/null +++ b/test/tm-cases/link_after_square_brackets.text @@ -0,0 +1,3 @@ +[before] +[Some link](https://google.com) +[after]