mad Thank you for your answer. Unfortunately I'm not very familiar with php. The file Lightbox.php is very short, but I'm not sure to identify where is defined to use only images to open the Lightbox and how I could enhance it 😶
class Lightbox {
public function Lightbox($str) {
// The pattern skips images already wrapped in a link.
$regex = '/(?<!\[)\!\[[^\]]*\]\(([\w\-\/\?\&\=\:\.]+)(?:\?(\d+)x(\d+))?\)/i';
$str = preg_replace_callback($regex, function($match) {
$file = AM_BASE_DIR . $match[1];
$link = $match[1];
$caption = '';
if (is_readable($file)) {
$caption = Core\Str::stripTags(Core\Parse::caption($file));
if (!empty($match[2]) && !empty($match[3])) {
$image = new Core\Image($file, $match[2], $match[3], true);
$link = $image->file;
}
}
return '<a href="' . $match[1] . '" class="automad-lightbox-item" data-caption="' . $caption . '"><img src="' . $link . '"></a>';
}, $str);
return $str;;
}
}