jonasmerlin / astro-seo

Makes it easy to add information that is relevant for SEO to your Astro app.
MIT License
908 stars 50 forks source link

Undesired escaping of characters #74

Open trueter opened 11 months ago

trueter commented 11 months ago

I am passing an & character in my openGraph.basic.title field. I verified that the char is correctly passed as a prop into the SEO component, but in my final output it is changed to: <meta property="og:title" content="[...] &#38; [...]">

Any ideas?

jonasmerlin commented 11 months ago

Hey @trueter, thank you for your feedback! I'll need a bit more context for this, though. Does the escaping have any unintended consequences where it doesn't get rendered correctly?

trueter commented 11 months ago

Hey @jonasmerlin - thanks for taking the time to look at this. I've had another look at it. Some platforms correctly show the ampersand in the preview, others, like https://opengraph.dev/ don't. I would sleep better at night knowing the output is consistent across platforms. In my research I found this thread on the react repo highlighting some use cases of why fine grained control of escaping in open graph strings may be beneficial (like image urls).