import { getFrameworkRuntime } from './js-preprocessors.js'; /** * Export a fiddle as a standalone HTML file and trigger download. */ export function exportHtml({ title, html, css, js, mode, extraCss = '', isModule = false }) { const runtime = getFrameworkRuntime(mode); const allCss = extraCss ? `${css}\n${extraCss}` : css; let bodyContent; if (mode === 'vue' || mode === 'svelte') { bodyContent = html ? `${html}\n${runtime.bodyHtml}` : runtime.bodyHtml; } else if (runtime.bodyHtml) { bodyContent = `${html}\n${runtime.bodyHtml}`; } else { bodyContent = html; } let scripts = ''; if (js) { if (isModule) { scripts = `