mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
improve comments
This commit is contained in:
parent
3e0c010c1f
commit
0494c6b274
@ -8,19 +8,16 @@
|
|||||||
# (c) Emanuil Rusev
|
# (c) Emanuil Rusev
|
||||||
# http://erusev.com
|
# http://erusev.com
|
||||||
#
|
#
|
||||||
# For the full license information, please view the LICENSE file that was
|
# For the full license information, view the LICENSE file that was distributed
|
||||||
# distributed with this source code.
|
# with this source code.
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
class Parsedown
|
class Parsedown
|
||||||
{
|
{
|
||||||
/**
|
#
|
||||||
* Multiton (http://en.wikipedia.org/wiki/Multiton_pattern)
|
# Multiton (http://en.wikipedia.org/wiki/Multiton_pattern)
|
||||||
*
|
|
||||||
* @param string $name
|
|
||||||
* @return Parsedown
|
|
||||||
*/
|
|
||||||
static function instance($name = 'default')
|
static function instance($name = 'default')
|
||||||
{
|
{
|
||||||
if (isset(self::$instances[$name]))
|
if (isset(self::$instances[$name]))
|
||||||
@ -43,12 +40,9 @@ class Parsedown
|
|||||||
|
|
||||||
private $breaks_enabled = false;
|
private $breaks_enabled = false;
|
||||||
|
|
||||||
/**
|
#
|
||||||
* Enables GFM line breaks.
|
# Enables GFM line breaks.
|
||||||
*
|
|
||||||
* @param bool $breaks_enabled
|
|
||||||
* @return $this
|
|
||||||
*/
|
|
||||||
function set_breaks_enabled($breaks_enabled)
|
function set_breaks_enabled($breaks_enabled)
|
||||||
{
|
{
|
||||||
$this->breaks_enabled = $breaks_enabled;
|
$this->breaks_enabled = $breaks_enabled;
|
||||||
@ -63,18 +57,15 @@ class Parsedown
|
|||||||
private $reference_map = array();
|
private $reference_map = array();
|
||||||
|
|
||||||
#
|
#
|
||||||
# Public Methods
|
# Actions
|
||||||
#
|
#
|
||||||
|
|
||||||
/**
|
#
|
||||||
* Converts Markdown to HTML.
|
# Converts Markdown to HTML.
|
||||||
*
|
|
||||||
* @param string $text
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function parse($text)
|
function parse($text)
|
||||||
{
|
{
|
||||||
# simplifies line breaks
|
# standardizes 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);
|
||||||
|
|
||||||
@ -97,7 +88,7 @@ class Parsedown
|
|||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Private Methods
|
# Methods
|
||||||
#
|
#
|
||||||
|
|
||||||
private function parse_block_elements(array $lines, $context = '')
|
private function parse_block_elements(array $lines, $context = '')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user