renatomarinho / laravel-page-speed

Package to optimize your site automatically which results in a 35%+ optimization
MIT License
2.4k stars 275 forks source link

Works incorrectly with JSON schema #179

Open grim-reapper opened 1 year ago

grim-reapper commented 1 year ago

I have google structured json data inside code, here is the json code

<script type = "application/ld+json" > {
    "@context": "https://schema.org",
    "@graph": [{
        "@type": "Organization",
        "url": "https://legal.com",
        "logo": "https://legal.com/img/logo.svg"
    }, {
        "@type": "Article",
        "url": "https://legal.com/ia/leasehold-conveyancing",
        "headline": "Leasehold conveyancing: process, timing and fees",
        "datePublished": "2023-05-25T11:51:50+05:00",
        "dateModified": "2023-05-25T00:00:00+05:00",
        "author": {
            "@type": "Organization",
            "name": "Net Lawman",
            "url": "https://legal.com"
        },
        "publisher": {
            "url": "https://legal.com",
            "name": "Net Lawman"
        },
        "copyrightYear": "2023",
        "copyrightHolder": {
            "url": "https://legal.com",
            "name": "Net Lawman"
        }
    }]
} </script>

the problem is the dns prefetch middleware rendering URLs from Json schema incorrectly. I'm attaching image how it's being rendered.

image

graph, publisher and name should not be in link tag. hope it will be fixed soon. Thanks!