nfl / react-helmet

A document head manager for React
MIT License
17.33k stars 661 forks source link

Structured data is displayed outside HTML tag #493

Open Alchy-web opened 4 years ago

Alchy-web commented 4 years ago

I have implemented a third party widget on my website to get Rich Snippets stars. The issue is that the Google-bot and Google structured-data testing-tool do not recognise the ld+json markup because it's outside the html tag. i have used React Helmet to force the script inside the head tag but in vain!

122HF

`return (

{comp}
)`
kokushkin commented 4 years ago

@Alchy-web , from documentation:

    {/* inline script elements */}
    <script type="application/ld+json">{`
        {
            "@context": "http://schema.org"
        }
    `}</script>