1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00

leading \n characters should not be parsed as part of first block

This commit is contained in:
Emanuil 2013-08-31 21:44:23 +03:00
parent 40c2dcfac7
commit 0352f01c7e

View File

@ -109,8 +109,10 @@ class Parsedown
private function parse_blocks($text)
{
$text = trim($text, "\n");
# 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.
$blocks []= NULL;