MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / htmlShell

Function htmlShell

src/artifacts/preview.ts:40–54  ·  view source on GitHub ↗
(body: string, head = '')

Source from the content-addressed store, hash-verified

38 'pre.__art_text{margin:0;padding:24px;white-space:pre-wrap;word-break:break-word;font:14px/1.6 ui-monospace,SFMono-Regular,Menlo,monospace;}';
39
40function htmlShell(body: string, head = ''): string {
41 return `<!doctype html>
42<html lang="en">
43<head>
44<meta charset="utf-8">
45<meta name="viewport" content="width=device-width,initial-scale=1">
46<title>QodeX Artifact Preview</title>
47<style>${BASE_STYLE}</style>
48${head}
49</head>
50<body>
51${body}
52</body>
53</html>`;
54}
55
56function escapeHtml(s: string): string {
57 return s.replace(/[&<>]/g, c => (c === '&' ? '&amp;' : c === '<' ? '&lt;' : '&gt;'));

Callers 4

reactHarnessFunction · 0.85
vueHarnessFunction · 0.85
markdownHarnessFunction · 0.85
buildPreviewHtmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected