mirror of
https://github.com/erusev/parsedown.git
synced 2025-09-10 14:50:51 +02:00
Use imperative tense in comments
This commit is contained in:
@@ -41,7 +41,7 @@ class Parsedown
|
|||||||
private $breaks_enabled = false;
|
private $breaks_enabled = false;
|
||||||
|
|
||||||
#
|
#
|
||||||
# Enables GFM line breaks.
|
# Enable GFM line breaks.
|
||||||
|
|
||||||
function set_breaks_enabled($breaks_enabled)
|
function set_breaks_enabled($breaks_enabled)
|
||||||
{
|
{
|
||||||
@@ -61,27 +61,27 @@ class Parsedown
|
|||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Converts Markdown to HTML.
|
# Convert Markdown to HTML.
|
||||||
|
|
||||||
function parse($text)
|
function parse($text)
|
||||||
{
|
{
|
||||||
# standardizes line breaks
|
# standardize 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
|
# replace tabs with spaces
|
||||||
$text = str_replace("\t", ' ', $text);
|
$text = str_replace("\t", ' ', $text);
|
||||||
|
|
||||||
# removes surrounding line breaks
|
# remove surrounding line breaks
|
||||||
$text = trim($text, "\n");
|
$text = trim($text, "\n");
|
||||||
|
|
||||||
# splits text into lines
|
# split text into lines
|
||||||
$lines = explode("\n", $text);
|
$lines = explode("\n", $text);
|
||||||
|
|
||||||
# converts lines into html
|
# convert lines into html
|
||||||
$text = $this->parse_block_elements($lines);
|
$text = $this->parse_block_elements($lines);
|
||||||
|
|
||||||
# removes trailing line breaks
|
# remove trailing line breaks
|
||||||
$text = chop($text, "\n");
|
$text = chop($text, "\n");
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
|
Reference in New Issue
Block a user