in src/inlines/Image.php [43:71]
public static function consume(
Context $context,
string $markdown,
int $offset,
): ?(Inline, int) {
if (Str\slice($markdown, $offset, 2) !== '![') {
return null;
}
$link = Link::consumeLinkish(
$context,
$markdown,
$offset + 1,
keyset[Link::class],
);
if ($link === null) {
return null;
}
list($link, $offset) = $link;
return tuple(
new self(
$link->getText(),
$link->getDestination(),
$link->getTitle(),
),
$offset,
);
}