1
0
mirror of https://github.com/erusev/parsedown.git synced 2025-09-03 03:42:38 +02:00

Merge pull request #598 from aidantwoods/enhancement/set-literal-breaks

Add literalBreaks support
This commit is contained in:
Aidan Woods
2018-04-06 15:06:45 +01:00
committed by GitHub
4 changed files with 32 additions and 2 deletions

View File

@@ -63,6 +63,15 @@ class Parsedown
protected $breaksEnabled;
function setLiteralBreaks($literalBreaks)
{
$this->literalBreaks = $literalBreaks;
return $this;
}
protected $literalBreaks;
function setMarkupEscaped($markupEscaped)
{
$this->markupEscaped = $markupEscaped;
@@ -167,7 +176,7 @@ class Parsedown
foreach ($lines as $line)
{
if (chop($line) === '')
if ( ! $this->literalBreaks and chop($line) === '')
{
if (isset($CurrentBlock))
{
@@ -230,7 +239,15 @@ class Parsedown
# ~
$marker = $text[0];
if (isset($text[0]))
{
$marker = $text[0];
}
elseif ($this->literalBreaks)
{
$marker = '\n';
$text = ' ';
}
# ~