-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Entities in computed attribute values? Suggested approach? #94
Comments
Hey thanks for the nice note :) I think what you're running into is React's auto-escaping by default? There's some ways around that documented here: https://shripadk.github.io/react/docs/jsx-gotchas.html -- does that help? |
Hi, @tizmagik – Sorry for the delayed response. Yes, I read through that. Unfortunately, I don't see a workaround for attributes. Unless I missing something obvious... Work correctly in the browser, just not with |
Oh interesting, hmm... do you know if the problem is specific to react-head or to renderToStaticMarkup? |
I've got something going on with my GitHub notifications because I never get a notice when you respond... Looks like it's an issue with ReactDOM's Which leads me back to the workaround... Seem's like this is definitely a JSX "gotcha." So unless there's some known workaround that I'm not aware of (which seems like the case), I think the only solutions are: a) not include ampersands in URL's (what I'm doing now) I'll fix my notifications :) cheers. |
It looks like React Helmet can allow special characters in generated SSR output by flipping the They're manually building the tag strings: Obviously a more complex approach than React Head takes. I'm going to close this issue by noting for posterity that React Head doesn't support this particular corner case since all rendered components for SSR are piped through React and therefore subject to React's JSX escaping rules. Thanks! |
Wonderful package :) I've been using it for a year or so, and it's awesome.
Question on usage when rendering a computed attribute that contains an ampersand (
&
). React likes to escape that to&
... any suggested workarounds?This is the use case:
The
content
attribute ends up looking like this when rendered withReactDOM.renderToStaticMarkup
:Thanks!
The text was updated successfully, but these errors were encountered: