trentm / python-markdown2

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

Fix images not being procesed correctly (#498) #499

Closed Crozzers closed 1 year ago

Crozzers commented 1 year ago

The issue was with the image processing in _do_links.

anchor_allowed_pos was not being set when images were processed. This was fine before #487 because when a markdown link was processed, the resulting text was usually longer, allowing anchor_allowed_pos to fall behind where the next link started.

After #487, URLs started to be hashed, which meant that the processed link could be shorter than the original text, meaning anchor_allowed_pos would overlap the start of the next link.

This PR fixes that by making sure anchor_allowed_pos is set correctly when processing links

nicholasserra commented 1 year ago

Nice thanks for the quick fix and test. I'm gonna put out a release for this.