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

improve comments

This commit is contained in:
Emanuil Rusev 2014-01-23 22:08:06 +02:00
parent 0c61f71e3f
commit 843786c07c

View File

@ -58,21 +58,23 @@ class Parsedown
function parse($text) function parse($text)
{ {
# removes \r characters # simplifies line breaks
$text = str_replace("\r\n", "\n", $text); $text = str_replace("\r\n", "\n", $text);
$text = str_replace("\r", "\n", $text); $text = str_replace("\r", "\n", $text);
# replaces tabs with spaces # replaces tabs with spaces
$text = str_replace("\t", ' ', $text); $text = str_replace("\t", ' ', $text);
# ~ # removes surrounding line breaks
$text = trim($text, "\n"); $text = trim($text, "\n");
# splits text into lines
$lines = explode("\n", $text); $lines = explode("\n", $text);
# converts lines into html
$text = $this->parse_block_elements($lines); $text = $this->parse_block_elements($lines);
# removes trailing line breaks
$text = chop($text, "\n"); $text = chop($text, "\n");
return $text; return $text;