trentm / python-markdown2

markdown2: A fast and complete implementation of Markdown in Python
Other
2.66k stars 433 forks source link

Fix incorrect parsing of links after square brackets (#552) #556

Closed Crozzers closed 10 months ago

Crozzers commented 10 months ago

This PR fixes #552.

The issue was with links following square brackets, eg: [text][link](google.com). The link parser would hit [text][link] and correctly identify that this isn't a valid link. It would then set the current position counter to the end of the entire "match", which included the section containing the valid link.

I've changed it to set the current position to directly after the first square brackets, so that it picks up on the link right after

nicholasserra commented 10 months ago

Thank you!