-
Notifications
You must be signed in to change notification settings - Fork 27.8k
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
React too eagerly sanitizes HTML entities #6718
Comments
@Timer I think the new title is slightly misleading. I used React bug just as a demonstration of a bigger problem. I don't think it's really possible to scale (in a business sense) SSR app without middlewares. |
Another consideration. With AWS ended up with Serverless. As Zeit is already on the path of abandoning Docker and the benefit of "No need to rewrite code" is no longer a selling point, it seems like the next logical step to me. |
Closing this because this is semantically valid HTML -- can you please provide a case where this doesn't work? https://codesandbox.io/s/6xn18 For example, the following code opens the link as you'd expect without <a target="_blank" href="http://example.com/?test=1&test2=test">Testing</a> Also, "Remove linebreaks in meta contents" sounds better served by fixing it in the place you're rendering a |
Consider SEO titles where you want
instead of
because:
Although many people claim the |
For the record, this issue started when we saw
like results in the Google SERP (search engine result page)! By logic, Google has to decode HTML entities, yes. But somehow it didn't (at least that time). |
This should probably be filed as a bug with Google -- if this still reproduces we can likely help ping people. |
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Now-2 and Next-8 require us to drop
server.js
-based approach to serve SSR in production, and replace it with lambdas and route configs. I fully understand the reasoning behind this and I don't question it. Hovewer, theserver.js
file was useful not only to apply routing but to inject middlewares! Middlewares were necessary, for example, to fix a bunch of annoying problems with React.facebook/react#13838
facebook/react#3879
See fix-1 below.
See fix-2 below.
You can say "meh, it's just React bugs". The problem is that such bugs can be very long-lasting and quite detremental to SEO (ruining og attributes for example).
And the list of such issues can be expanded. Not necessary NextJS-related but I remember fixing HTML after ReactRouter + Helmet and so on. The bottom line is that similar issues and answers like "You can only fix it in HTML" are regular at StackOverflow.
server.js
allowed us to inject whatever middlewares we wanted. Unless I miss something, Now-2 + Next-8 do not leave any option to apply custom middlewares. It's quite a limitation, you know.The text was updated successfully, but these errors were encountered: