Commit 7249d02c authored by Emanuil Rusev's avatar Emanuil Rusev
Browse files

code blocks get unwanted empty lines

parent ecf86b07
......@@ -216,7 +216,12 @@ class Parsedown
{
if ($element['type'] === 'code')
{
isset($element['interrupted']) and $element['text'] .= "\n";
if (isset($element['interrupted']))
{
$element['text'] .= "\n";
unset ($element['interrupted']);
}
$element['text'] .= "\n".$matches[1];
}
......
<p>Here's a regular code block:</p>
<pre><code>&lt;?php
echo 'Hello World!';
?&gt;</code></pre>
<p>Here's one that holds a list:</p>
<pre><code>- list item
<p>Here's a code block:</p>
<pre><code>&lt;?php
$message = 'Hello World!';
echo $message;</code></pre>
<p>Here's one that holds a list:</p>
<pre><code>- list item
- another list item</code></pre>
\ No newline at end of file
Here's a regular code block:
<?php
echo 'Hello World!';
?>
Here's one that holds a list:
- list item
- another list item
Here's a code block:
<?php
$message = 'Hello World!';
echo $message;
Here's one that holds a list:
- list item
- another list item
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment