<template> is more semantically correct and won't be confused for actual content.
e.preventDefault();
const encrypted = document.querySelector('#ciphertext').textContent;
const scriptInjection = `<script>const content = '${encrypted}'; ${decrypt.toString()}<\/script>`;
- const output = template.replace('<div>SCRIPT INJECTION</div>', scriptInjection);
+ const output = template.replace('<template id="script-injection"></template>', scriptInjection);
downloadHtml(output, `${Date.now()}.html`);
})
</form>
</main>
- <div>SCRIPT INJECTION</div>
+ <template id="script-injection"></template>
<script>
const input = document.querySelector('input');