From 843786c07ce6aed17e70ebcf12d10dce4f0f559f Mon Sep 17 00:00:00 2001 From: Emanuil Rusev Date: Thu, 23 Jan 2014 22:08:06 +0200 Subject: [PATCH] improve comments --- Parsedown.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Parsedown.php b/Parsedown.php index 295c893..dda6bd6 100755 --- a/Parsedown.php +++ b/Parsedown.php @@ -58,21 +58,23 @@ class Parsedown function parse($text) { - # removes \r characters + # simplifies line breaks $text = str_replace("\r\n", "\n", $text); $text = str_replace("\r", "\n", $text); # replaces tabs with spaces $text = str_replace("\t", ' ', $text); - # ~ - + # removes surrounding line breaks $text = trim($text, "\n"); + # splits text into lines $lines = explode("\n", $text); + # converts lines into html $text = $this->parse_block_elements($lines); + # removes trailing line breaks $text = chop($text, "\n"); return $text;