Replies: 4 comments
-
Just for context, I am introducing google structured data on my website. As in the link below: https://developers.google.com/search/docs/guides/intro-structured-data The double quotes (") get transformed to " after the below in server.js
The tool which is here does not seem to support " in place of " |
Beta Was this translation helpful? Give feedback.
-
I resolved this by using dangerouslySetInnerHTML within the script tag. |
Beta Was this translation helpful? Give feedback.
-
Hey @Jaikant I am facing a similar problem in react and do not understand what you did please can you further explain with example perhaps |
Beta Was this translation helpful? Give feedback.
-
<div dangerouslySetInnerHTML={{
__html: `<p>Hello</p>`
}} /> <script dangerouslySetInnerHTML={{
__html: `console.log("Hello")`
}} /> https://reactjs.org/docs/dom-elements.html#dangerouslysetinnerhtml |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In my JSX a double quote " is getting transformed to "
I am guessing it could be babel which is doing this? Any ideas? How do I retain the double quotes?
The double quote is part of a string.
Like this <script> {' some text " '} </script>
Notice the double quotes after 'some text' above
I tried to use a back tick ()` instead of the single quote for the string, but it did not help.
Beta Was this translation helpful? Give feedback.
All reactions