diff --git a/package.json b/package.json index e1bfa08..8d7cdc5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "the-fold-within", - "version": "3.0.1", + "version": "3.0.2", "dependencies": { "pdf-parse": "^1.1.1" } diff --git a/public/app.js b/public/app.js index 93c8638..cf895d9 100755 --- a/public/app.js +++ b/public/app.js @@ -201,29 +201,11 @@ async function handleHash() { const src = await fetch(indexFile.path).then(r => r.ok ? r.text() : ""); const html = marked.parse(src || `# ${currentPath.split("/").pop()}\n\nNo content yet.`); els.viewer.innerHTML = `
${html}
`; + } else if (indexFile.ext === ".html") { + // Use unified bounded renderer even for nested index.html + renderIframe(indexFile.path); } else { - const iframe = document.createElement("iframe"); - iframe.src = "/" + indexFile.path; - iframe.loading = "eager"; - iframe.setAttribute("sandbox", "allow-same-origin allow-scripts allow-forms"); - els.viewer.appendChild(iframe); - - iframe.onload = () => { - try { - const doc = iframe.contentDocument; - const body = doc.body; - const hasContent = body && body.innerText.trim().length > 50; - if (!hasContent) { - doc.body.innerHTML = ` -
-

${currentPath.split("/").pop()}

-

No content yet.

-
- `; - doc.body.style.background = "#0b0b0b"; - } - } catch (e) {} - }; + els.viewer.innerHTML = `

${currentPath.split("/").pop()}

Unsupported type.

`; } } catch (e) { els.viewer.innerHTML = `

${currentPath.split("/").pop()}

No content yet.

`;