① Input HTML

② Insert Module at Preview Cursor

先在 Live Preview 里点击文字位置,出现光标后,再点击下面按钮,模块会插入到光标处。

Module Background

Global Preview Style

③ Live Preview

④ Export HTML

点击 Copy Body HTML 后,会自动清理编辑器按钮和 contenteditable 属性,只输出正文 HTML。

`; const iframe = document.getElementById("clawPreviewFrame"); iframe.srcdoc = fullHTML; } function clawInsertModuleAtPreviewCursor(layout) { const iframe = document.getElementById("clawPreviewFrame"); const bgColor = document.getElementById("clawModuleBgSelect").value; iframe.contentWindow.postMessage({ type: "claw-insert-module", layout: layout, bgColor: bgColor }, "*"); } function clawAddLink() { const iframe = document.getElementById("clawPreviewFrame"); const iframeWindow = iframe.contentWindow; const iframeDoc = iframe.contentDocument || iframeWindow.document; const url = document.getElementById("clawLinkUrl").value.trim(); if (!url) { alert("Please enter a URL."); return; } iframeWindow.focus(); const selection = iframeWindow.getSelection(); if (!selection || selection.rangeCount === 0 || selection.toString().trim() === "") { alert("Please select text inside the live preview first."); return; } const range = selection.getRangeAt(0); const a = iframeDoc.createElement("a"); a.href = url; a.textContent = selection.toString(); a.style.color = clawGetPreset().link; a.style.textDecoration = "underline"; range.deleteContents(); range.insertNode(a); clawUpdateOutputFromPreview(); } function clawUpdateOutputFromPreview() { const iframe = document.getElementById("clawPreviewFrame"); const iframeDoc = iframe.contentDocument || iframe.contentWindow.document; const content = iframeDoc.querySelector(".content"); if (!content) return; const clone = content.cloneNode(true); clone.querySelectorAll(".claw-delete-btn").forEach(function(btn) { btn.remove(); }); clone.querySelectorAll("[contenteditable]").forEach(function(el) { el.removeAttribute("contenteditable"); }); clone.querySelectorAll("[data-claw-editor]").forEach(function(el) { el.removeAttribute("data-claw-editor"); }); document.getElementById("clawOutputHTML").value = clone.innerHTML.trim(); } window.addEventListener("message", function(event) { if (event.data && event.data.type === "claw-sync") { document.getElementById("clawOutputHTML").value = event.data.html; } }); function clawCopyBodyHTML() { clawUpdateOutputFromPreview(); const output = document.getElementById("clawOutputHTML"); output.select(); output.setSelectionRange(0, 999999); try { document.execCommand("copy"); alert("Body HTML copied!"); } catch (err) { alert("Copy failed. Please copy manually from the output box."); } } clawRenderPreview();