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:
parent
726d4ef44a
commit
88a3f31dd7
@ -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']['allowRawHtmlInSafeMode'] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$Inline['element']['rawHtml'] = preg_replace('/(?:[ ]*+\\\\|[ ]{2,}+)\n/', "<br />\n", $safeText);
|
||||
$Inline['element']['allowRawHtmlInSafeMode'] = true;
|
||||
}
|
||||
$Inline['element']['rawHtml'] = preg_replace(
|
||||
$this->breaksEnabled ? '/[ ]*+\n/' : '/(?:[ ]*+\\\\|[ ]{2,}+)\n/',
|
||||
"<br />\n",
|
||||
$safeText
|
||||
);
|
||||
$Inline['element']['allowRawHtmlInSafeMode'] = true;
|
||||
|
||||
return $Inline;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user