Fix issue where footer/name can break templates

stringify the template variables at render time

JSON.stringify - will escape out quotes
<%- renders as-is without any more escaping
This commit is contained in:
Girish Ramakrishnan
2025-11-23 11:17:59 +01:00
parent 00ae320b51
commit e87d2e1218
6 changed files with 39 additions and 33 deletions

View File

@@ -4,10 +4,11 @@
<title><%= name %> Account Setup</title>
<script>
window.cloudron = {};
window.cloudron.name = '<%= name %>';
window.cloudron.footer = `<%- footer -%>`;
window.cloudron.language = `<%= language %>`;
window.cloudron = <%- JSON.stringify({
name: name,
footer: footer,
language: language
}) %>;
</script>
</head>