MCPcopy
hub / github.com/027xiguapi/code-box / saveHtml

Function saveHtml

tools.ts:51–58  ·  view source on GitHub ↗
(dom: Element, filename?: string)

Source from the content-addressed store, hash-verified

49}
50
51export function saveHtml(dom: Element, filename?: string) {
52 if (dom) {
53 const htmlContent = dom.outerHTML
54 const blob = new Blob([htmlContent], { type: "text/html;charset=utf-8" })
55 filename = filename || "CodeBox-page"
56 saveAs(blob, `${filename}-${dayjs().format("YYYY-MM-DD HH:mm:ss")}.html`)
57 }
58}
59
60export function saveMarkdown(markdown: string, filename?: string) {
61 if (markdown) {

Callers 15

handleOkModalFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85
downloadHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected