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

Attempted fix for stripped classes on images with ParsedownExtra - re: https://github.com/erusev/parsedown-extra/issues/32

This commit is contained in:
Andy Miller 2015-01-10 19:40:39 -07:00
parent 098f188552
commit 03ff22c7df

View File

@ -1298,6 +1298,8 @@ class Parsedown
$Inline = $this->inlineLink($excerpt);
$backup = $Inline;
if ($Inline === null)
{
return;
@ -1305,14 +1307,12 @@ class Parsedown
$Inline['extent'] ++;
$Inline['element'] = array(
'name' => 'img',
'attributes' => array(
'src' => $Inline['element']['attributes']['href'],
'alt' => $Inline['element']['text'],
'title' => $Inline['element']['attributes']['title'],
),
);
$Inline['element']['name'] = 'img';
$Inline['element']['attributes']['src'] = $Inline['element']['attributes']['href'];
unset($Inline['element']['attributes']['href']);
$Inline['element']['attributes']['alt'] = $Inline['element']['text'];
unset($Inline['element']['text']);
return $Inline;
}