erusev/parsedown

Parsedown not counting linebreaks properly? Images also wrapped in <p> tags.

scottynorris opened this issue · 0 comments

My current usage:

$markdown = file_get_contents($filepath); 
new Parsedown(); ?>

echo Parsedown::instance()
   ->setBreaksEnabled(true) # enables automatic line breaks
   ->text($markdown);

My file:

Blah blah blah
Blah.
![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png "Logo Title Text 1")

This outputs:

<p>Blah blah blah</p>
<p>Blah.</p>
<p><img src="https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png" alt="alt text" title="Logo Title Text 1" /></p>

How comes it's not counting the line breaks and why is it added p tags to the image?

Many thanks!