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:
parent
098f188552
commit
03ff22c7df
@ -1298,6 +1298,8 @@ class Parsedown
|
|||||||
|
|
||||||
$Inline = $this->inlineLink($excerpt);
|
$Inline = $this->inlineLink($excerpt);
|
||||||
|
|
||||||
|
$backup = $Inline;
|
||||||
|
|
||||||
if ($Inline === null)
|
if ($Inline === null)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
@ -1305,14 +1307,12 @@ class Parsedown
|
|||||||
|
|
||||||
$Inline['extent'] ++;
|
$Inline['extent'] ++;
|
||||||
|
|
||||||
$Inline['element'] = array(
|
$Inline['element']['name'] = 'img';
|
||||||
'name' => 'img',
|
$Inline['element']['attributes']['src'] = $Inline['element']['attributes']['href'];
|
||||||
'attributes' => array(
|
unset($Inline['element']['attributes']['href']);
|
||||||
'src' => $Inline['element']['attributes']['href'],
|
|
||||||
'alt' => $Inline['element']['text'],
|
$Inline['element']['attributes']['alt'] = $Inline['element']['text'];
|
||||||
'title' => $Inline['element']['attributes']['title'],
|
unset($Inline['element']['text']);
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return $Inline;
|
return $Inline;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user