mirror of
https://github.com/erusev/parsedown.git
synced 2023-08-10 21:13:06 +03:00
lazy loading for images
This commit is contained in:
parent
18eac15b36
commit
2d19715a1d
|
@ -1415,12 +1415,16 @@ class Parsedown
|
||||||
'name' => 'img',
|
'name' => 'img',
|
||||||
'attributes' => array(
|
'attributes' => array(
|
||||||
'class' => 'mb-6',
|
'class' => 'mb-6',
|
||||||
|
'loading' => 'lazy',
|
||||||
'src' => $Link['element']['attributes']['href'],
|
'src' => $Link['element']['attributes']['href'],
|
||||||
'alt' => $Link['element']['handler']['argument'],
|
'alt' => $Link['element']['handler']['argument'],
|
||||||
),
|
),
|
||||||
'autobreak' => true,
|
'autobreak' => true,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
if ($Inline['element']['attributes']['alt']) {
|
||||||
|
$Inline['element']['attributes']['title'] = $Inline['element']['attributes']['alt'];
|
||||||
|
}
|
||||||
|
|
||||||
$Inline['element']['attributes'] += $Link['element']['attributes'];
|
$Inline['element']['attributes'] += $Link['element']['attributes'];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user