windows 10 pro office 2019 pro office 365 pro windows 10 home windows 10 enterprise office 2019 home and business office 2016 pro windows 10 education visio 2019 microsoft project 2019 microsoft project 2016 visio professional 2016 windows server 2012 windows server 2016 windows server 2019 Betriebssysteme office software windows server instagram takipçi instagram beğeni instagram görüntüleme instagram otomatik beğeni facebook beğeni facebook sayfa beğenisi facebook takipçi twitter takipçi twitter beğeni twitter retweet youtube izlenme youtube abone instagram

React mistakenly html escapes quotes in attribute names

Asked By: Anonymous

I have a Next.js / (SSR React) app. I am passing a property through props into a meta component. The tag that gets the string looks like this:



 <meta property="og:description" content={ `${description}` } />




The content being put in there looks like this: "This is a quote" - Quotes" from a javascript string. The result looks like this: &quot;This is a quote &quot;. What I am looking for is the string that’s passed into the meta tag, not escaped double quotes. What is going on here and how can I fix i?

PS: I tried using unicode chars, putting the description outside of a string literal, and something like let q = String.chartocode(38) then adding q in place of double quotes. All had the same result.


Answered By: Anonymous

This is proper escaping, since <meta property="og:description" content=""This is a quote" - Quotes" /> is not valid html. The double quotes need to be escaped.

Further, OpenGraph does support html entities in attributes, so &quot;This is a quote&quot; - Quotes should be displayed as "This is a quote" - Quotes in the OpenGraph parsed view.

techinplanet staff

Windows 10 Kaufen Windows 10 Pro Office 2019 Kaufen Office 365 Lizenz Windows 10 Home Lizenz Office 2019 Home Business Kaufen windows office 365 satın al follower kaufen instagram follower kaufen porno