mirror of
https://github.com/erusev/parsedown.git
synced 2024-09-20 03:51:29 +02:00
leading \n characters should not be parsed as part of first block
This commit is contained in:
parent
40c2dcfac7
commit
0352f01c7e
@ -109,8 +109,10 @@ class Parsedown
|
|||||||
|
|
||||||
private function parse_blocks($text)
|
private function parse_blocks($text)
|
||||||
{
|
{
|
||||||
|
$text = trim($text, "\n");
|
||||||
|
|
||||||
# Divides text into blocks.
|
# Divides text into blocks.
|
||||||
$blocks = preg_split('/\n\s*\n/', $text, -1, PREG_SPLIT_NO_EMPTY);
|
$blocks = preg_split('/\n\s*\n/', $text);
|
||||||
|
|
||||||
# Makes sure compound blocks get rendered.
|
# Makes sure compound blocks get rendered.
|
||||||
$blocks []= NULL;
|
$blocks []= NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user