mirror of
https://github.com/kingomarnajjar/flex-template-web.git
synced 2026-07-27 09:13:14 +10:00
Template function didn't understood stuff inside script tags.
This commit is contained in:
parent
71ab7c33e0
commit
3c597ea2cf
2 changed files with 2 additions and 2 deletions
|
|
@ -5,7 +5,7 @@
|
|||
<!--!title-->
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
|
||||
<script><!--!preloadedStateScript--></script>
|
||||
<!--!preloadedStateScript-->
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"><!--!body--></div>
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ function render(requestUrl, context, preloadedState) {
|
|||
// by replacing '<' character with its unicode equivalent.
|
||||
// http://redux.js.org/docs/recipes/ServerRendering.html#security-considerations
|
||||
const preloadedStateScript = `
|
||||
window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\u003c')};
|
||||
<script>window.__PRELOADED_STATE__ = ${JSON.stringify(preloadedState).replace(/</g, '\\u003c')};</script>
|
||||
`;
|
||||
|
||||
return template({ title: head.title.toString(), preloadedStateScript, body });
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue