diff --git a/modules/rspace/mod.ts b/modules/rspace/mod.ts index 6020b1e..47d4b4f 100644 --- a/modules/rspace/mod.ts +++ b/modules/rspace/mod.ts @@ -16,34 +16,90 @@ const DIST_DIR = resolve(import.meta.dir, "../../dist"); const routes = new Hono(); +/** + * Extract body content and scripts from the full canvas.html page. + * Strips the shell chrome (header, tab-bar, welcome overlay) that renderShell provides, + * and returns just the canvas-specific DOM + inline styles + module scripts. + */ +function extractCanvasContent(html: string): { body: string; styles: string; scripts: string } { + // Extract inline