kzykhys / Ciconia

A New Markdown parser for PHP5.4
http://ciconia.kzykhys.com/
MIT License
355 stars 31 forks source link

InlineStyleExtension bug for img tag when using underscores #26

Closed Pym closed 10 years ago

Pym commented 10 years ago
![thumb_01.png](/uploads/0001/01/thumb_01.png)

renders as:

<img src="/uploads/0001/01/thumb&lt;em&gt;01.png" alt="thumb&lt;/em&gt;01.png">

instead of:

<img src="/uploads/0001/01/thumb_01.png" alt="thumb_01.png">
Pym commented 10 years ago

Adding a little verification in processItalic seems to do the trick:

if ($text->match('/^<img .+>$/')) {
    return;
}

But I hope that there is a better solution, because I'm definitely not fan of regex playing with HTML...

kzykhys commented 10 years ago

@Pym Thank you for reporting. I will release 1.0.2.

Pym commented 10 years ago

Wow, that was quick! Thank you!