mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-29 19:34:29 +01:00
Pages `/design-html` builds from the bundled Pretext copy now run instead of throwing `prepareWithSegments is not defined` on their first text-layout call. The skill pasted the bundle into the page's own module script, where its renamed exports never define those names; it now ships a small scaffold that loads the bundle as its own module, still with no network requests. Nothing to do: the next `/design-html` run uses the new recipe. Found and diagnosed by @Akkyman2 in #4855. Co-authored-by: Akkyman2 <178076175+Akkyman2@users.noreply.github.com> Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
10 lines
590 B
HTML
10 lines
590 B
HTML
<!-- Pretext (vendored) sits here as inert text and loads as its own module from a blob: URL, so the page needs no network. A Content-Security-Policy must allow blob: scripts. -->
|
|
<script type="text/plain" id="pretext-src">
|
|
PRETEXT_BUNDLE
|
|
</script>
|
|
<script type="module">
|
|
const pretextURL = URL.createObjectURL(new Blob([document.getElementById('pretext-src').text], { type: 'text/javascript' }))
|
|
const { prepare, layout, prepareWithSegments, walkLineRanges, layoutNextLine, layoutWithLines } = await import(pretextURL).finally(() => URL.revokeObjectURL(pretextURL))
|
|
// page code
|
|
</script>
|