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

Refactor based on suggestion by @PhrozenByte

This commit is contained in:
Aidan Woods 2018-03-18 19:42:14 +00:00
parent 624a08b7eb
commit 88dc949890
No known key found for this signature in database
GPG Key ID: 9A6A8EFAA512BBB9

View File

@ -1500,21 +1500,8 @@ class Parsedown
{
$text = $Element['rawHtml'];
$allowRawHtmlInSafeMode = false;
if (isset($Element['allowRawHtmlInSafeMode']))
{
$allowRawHtmlInSafeMode = (true === $Element['allowRawHtmlInSafeMode']);
}
if ($this->safeMode !== true)
{
$permitRawHtml = true;
}
elseif ($this->safeMode and $allowRawHtmlInSafeMode)
{
$permitRawHtml = true;
}
$allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode'];
$permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode;
}
if (isset($text))
@ -1530,7 +1517,7 @@ class Parsedown
{
$markup .= $this->{$Element['handler']}($text, $Element['nonNestables']);
}
elseif ($permitRawHtml !== true)
elseif (!$permitRawHtml)
{
$markup .= self::escape($text, true);
}