mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-11-04 22:38:43 +00:00
Change HTML replace to use function as replacement value
This commit is contained in:
+7
-5
@@ -283,11 +283,13 @@ export default async function createApp(vite) {
|
||||
const safeProps = JSON.stringify(props).replace(/<(?=\/?script)/ig, '\\u003c');
|
||||
html = html.replace(
|
||||
'<head>',
|
||||
`<head>\n`
|
||||
+ `<script id="props">`
|
||||
+ `window.__INITIAL_PROPS__ = ` + safeProps
|
||||
+ `</script>\n`
|
||||
+ ogMetaTags
|
||||
()=>{
|
||||
return `<head>\n`
|
||||
+ `<script id="props">`
|
||||
+ `window.__INITIAL_PROPS__ = ${safeProps
|
||||
}</script>\n${
|
||||
ogMetaTags}`;
|
||||
}
|
||||
);
|
||||
|
||||
return html;
|
||||
|
||||
Reference in New Issue
Block a user