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

Rewrite as one statement

This commit is contained in:
Aidan Woods 2018-04-12 19:33:01 +01:00
parent 726d4ef44a
commit 88a3f31dd7
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -1196,16 +1196,12 @@ class Parsedown
$safeText = self::escape($text, true);
if ($this->breaksEnabled)
{
$Inline['element']['rawHtml'] = preg_replace('/[ ]*+\n/', "<br />\n", $safeText);
$Inline['element']['rawHtml'] = preg_replace(
$this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[ ]*+\\\\|[ ]{2,}+)\n/',
"<br />\n",
$safeText
);
$Inline['element']['allowRawHtmlInSafeMode'] = true;
}
else
{
$Inline['element']['rawHtml'] = preg_replace('/(?:[ ]*+\\\\|[ ]{2,}+)\n/', "<br />\n", $safeText);
$Inline['element']['allowRawHtmlInSafeMode'] = true;
}
return $Inline;
}