mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
setters should know nothing
This commit is contained in:
parent
354842fd6e
commit
4e83d79d76
@ -37,11 +37,11 @@ class Parsedown
|
|||||||
# Setters
|
# Setters
|
||||||
#
|
#
|
||||||
|
|
||||||
private $break_marker = " \n";
|
private $breaks_enabled = false;
|
||||||
|
|
||||||
function set_breaks_enabled($breaks_enabled)
|
function set_breaks_enabled($breaks_enabled)
|
||||||
{
|
{
|
||||||
$this->break_marker = $breaks_enabled ? "\n" : " \n";
|
$this->breaks_enabled = $breaks_enabled;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@ -520,6 +520,8 @@ class Parsedown
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
$this->breaks_enabled and $element['text'] .= ' ';
|
||||||
|
|
||||||
$element['text'] .= "\n".$line;
|
$element['text'] .= "\n".$line;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -649,7 +651,7 @@ class Parsedown
|
|||||||
return $markup;
|
return $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function parse_span_elements($text, $markers = array('![', '&', '*', '<', '[', '\\', '_', '`', 'http', '~~'))
|
private function parse_span_elements($text, $markers = array(" \n", '![', '&', '*', '<', '[', '\\', '_', '`', 'http', '~~'))
|
||||||
{
|
{
|
||||||
if (isset($text[1]) === false or $markers === array())
|
if (isset($text[1]) === false or $markers === array())
|
||||||
{
|
{
|
||||||
@ -708,6 +710,14 @@ class Parsedown
|
|||||||
|
|
||||||
switch ($closest_marker)
|
switch ($closest_marker)
|
||||||
{
|
{
|
||||||
|
case " \n":
|
||||||
|
|
||||||
|
$markup .= '<br />'."\n";
|
||||||
|
|
||||||
|
$offset = 3;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
case '![':
|
case '![':
|
||||||
case '[':
|
case '[':
|
||||||
|
|
||||||
@ -983,8 +993,6 @@ class Parsedown
|
|||||||
$markers[$closest_marker_index] = $closest_marker;
|
$markers[$closest_marker_index] = $closest_marker;
|
||||||
}
|
}
|
||||||
|
|
||||||
$markup = str_replace($this->break_marker, '<br />'."\n", $markup);
|
|
||||||
|
|
||||||
return $markup;
|
return $markup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user