trentm / python-markdown2

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

Formatting error when input contains multiple words surrounded by triple asterisks #555

Closed ryanvilbrandt closed 9 months ago

ryanvilbrandt commented 9 months ago

Describe the bug When the markdown input contains multiple words surrounded by triple asterisks (bold and italics), the output is improperly formatted.

To Reproduce

BELFRY: In fact, what would you know about ***ANY*** of this?!
BELFRY: You've never had to look after anything in your ***LIFE!***

Expected behavior I expect the output to look like this:

<p>BELFRY: In fact, what would you know about <strong><em>ANY</em></strong> of this?!<br />
BELFRY: You've never had to look after anything in your <strong><em>LIFE!</em></strong></p>

Actual behavior Output:

<p>BELFRY: In fact, what would you know about <strong><em>ANY</em><em>* of this?!<br />
BELFRY: You've never had to look after anything in your *</em><em>LIFE!</em></strong></p>

Debug info Version of library being used: 2.4.11

Any extras being used: strike, break-on-newline

Additional context This bug was introduced in 2.4.11. The output is formatted properly on 2.4.10.

Crozzers commented 9 months ago

I tested against 2.4.11 and then master and the bug has since been resolved (I think by #545). Until 2.4.12 gets released, a workaround could be to install version <=2.4.10

nicholasserra commented 9 months ago

2.4.12 has now been released, thanks!