mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
7249d02cff | |||
ecf86b073e |
@ -78,7 +78,7 @@ class Parsedown
|
|||||||
# ~
|
# ~
|
||||||
|
|
||||||
$text = preg_replace('/\n\s*\n/', "\n\n", $text);
|
$text = preg_replace('/\n\s*\n/', "\n\n", $text);
|
||||||
$text = trim($text, "\n");
|
$text = trim($text, "\n ");
|
||||||
|
|
||||||
$lines = explode("\n", $text);
|
$lines = explode("\n", $text);
|
||||||
|
|
||||||
@ -216,7 +216,12 @@ class Parsedown
|
|||||||
{
|
{
|
||||||
if ($element['type'] === 'code')
|
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];
|
$element['text'] .= "\n".$matches[1];
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
<p>Here's a regular code block:</p>
|
<p>Here's a code block:</p>
|
||||||
<pre><code><?php
|
<pre><code><?php
|
||||||
|
|
||||||
echo 'Hello World!';
|
$message = 'Hello World!';
|
||||||
|
echo $message;</code></pre>
|
||||||
?></code></pre>
|
<p>Here's one that holds a list:</p>
|
||||||
<p>Here's one that holds a list:</p>
|
<pre><code>- list item
|
||||||
<pre><code>- list item
|
|
||||||
- another list item</code></pre>
|
- another list item</code></pre>
|
@ -1,13 +1,12 @@
|
|||||||
Here's a regular code block:
|
Here's a code block:
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
echo 'Hello World!';
|
$message = 'Hello World!';
|
||||||
|
echo $message;
|
||||||
?>
|
|
||||||
|
Here's one that holds a list:
|
||||||
Here's one that holds a list:
|
|
||||||
|
- list item
|
||||||
- list item
|
- another list item
|
||||||
- another list item
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user