Update parsedown 1.7.3 -> 1.7.4

This commit is contained in:
Anaggh S 2020-01-01 16:24:11 +05:30
parent 3e15163240
commit b62194a3c3
1 changed files with 23 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class Parsedown
{ {
# ~ # ~
const version = '1.7.3'; const version = '1.7.4';
# ~ # ~
@ -1489,7 +1489,22 @@ class Parsedown
} }
} }
$permitRawHtml = false;
if (isset($Element['text'])) if (isset($Element['text']))
{
$text = $Element['text'];
}
// very strongly consider an alternative if you're writing an
// extension
elseif (isset($Element['rawHtml']))
{
$text = $Element['rawHtml'];
$allowRawHtmlInSafeMode = isset($Element['allowRawHtmlInSafeMode']) && $Element['allowRawHtmlInSafeMode'];
$permitRawHtml = !$this->safeMode || $allowRawHtmlInSafeMode;
}
if (isset($text))
{ {
$markup .= '>'; $markup .= '>';
@ -1500,11 +1515,15 @@ class Parsedown
if (isset($Element['handler'])) if (isset($Element['handler']))
{ {
$markup .= $this->{$Element['handler']}($Element['text'], $Element['nonNestables']); $markup .= $this->{$Element['handler']}($text, $Element['nonNestables']);
}
elseif (!$permitRawHtml)
{
$markup .= self::escape($text, true);
} }
else else
{ {
$markup .= self::escape($Element['text'], true); $markup .= $text;
} }
$markup .= '</'.$Element['name'].'>'; $markup .= '</'.$Element['name'].'>';