╭ changed ──────────╮ │src/embed/script.js│ ╰───────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭───────────────────────────────────────────────────────────────────────────╮ │1 const grid = document.getElementById("grid"); │ │2 const overlay = document.getElementById("overlay"); │ │3 -const pageJsonBase64 = document.getElementById("page-data").textContent;│ │3 +const pageJson = document.getElementById("page-data").textContent; │ │4 │ │5 let wasmInstance; │ │6 const decoder = new TextDecoder(); │ ╰───────────────────────────────────────────────────────────────────────────╯ ╭──────────────────────────────────────────────────────────────────────────────────────────────────╮ │159 await document.fonts.ready; │ │160 } │ │161 │ │162 - // the page is embedded as base64 so it can sit inside the host html │ │163 - // without worrying about characters that would terminate the script tag. │ │164 - // decode here and hand the raw json bytes to the wasm. │ │165 - const jsonBytes = Uint8Array.from(atob(pageJsonBase64), (c) => c.charCodeAt(0)); │ │162 + // the page is embedded as raw json in a script tag. │ │163 + // encode to utf-8 bytes and hand it to the wasm. │ │164 + const jsonBytes = encoder.encode(pageJson); │ │165 const ptr = wasmInstance.exports._alloc(jsonBytes.length); │ │166 new Uint8Array(wasmInstance.exports.memory.buffer, ptr, jsonBytes.length).set(jsonBytes);│ │167 wasmInstance.exports._init(ptr, jsonBytes.length, minRows(), maxCols()); │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯