Large body content that should never be parsed.

HTML; $meta = app(UrlMetaScraper::class)->parseFromHtml($html, 'https://example.com/blog/post'); expect($meta)->toMatchArray([ 'title' => 'OG Title', 'description' => 'OG Description', 'image' => 'https://example.com/images/preview.jpg', ]); }); it('falls back to twitter and standard meta tags when open graph is missing', function () { $html = <<<'HTML' HTML; $meta = app(UrlMetaScraper::class)->parseFromHtml($html, 'https://example.com'); expect($meta)->toMatchArray([ 'title' => 'Twitter Title', 'description' => 'Twitter Description', 'image' => 'https://cdn.example.com/card.png', ]); }); it('supports reversed meta attribute order and html entities', function () { $html = <<<'HTML' HTML; $meta = app(UrlMetaScraper::class)->parseFromHtml($html, 'https://example.com/page'); expect($meta)->toMatchArray([ 'title' => 'Tom & Jerry', 'description' => 'Classic cartoon', 'image' => 'https://cdn.example.com/og.jpg', ]); }); it('returns title only when no other metadata is present', function () { $html = 'Only Title'; $meta = app(UrlMetaScraper::class)->parseFromHtml($html, 'https://example.com'); expect($meta)->toBe([ 'title' => 'Only Title', ]); });