in src/inlines/RawHTML.php [78:107]
private static function consumeHtmlComment(
string $in,
int $offset,
): ?(Inline, int) {
$match = self::consumeFencedSection($in, $offset, '<!--', '-->');
if ($match === null) {
return null;
}
list($comment, $offset) = $match;
$content = $comment->getContent();
$text = Str\slice($content, 4, Str\length($content) - 7);
if (Str\starts_with($text, '>')) {
return null;
}
if (Str\starts_with($text, '->')) {
return null;
}
if (Str\ends_with($text, '-')) {
return null;
}
if (Str\contains($text, '--')) {
return null;
}
return $match;
}