מהדר שפת א

קוד בשפת א

`; } /* ========================= הגנה על HTML ========================= */ function escapeHTML(text) { return String(text) .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); } /* ========================= פתיחת האתר החדש ========================= */ function openHTML() { if (!generatedHTML) { return; } var blob = new Blob( [generatedHTML], { type: "text/html;charset=utf-8" } ); var url = URL.createObjectURL(blob); window.open( url, "_blank" ); setTimeout( function () { URL.revokeObjectURL(url); }, 60000 ); } /* ========================= העתקה ========================= */ function copyHTML() { if (!generatedHTML) { return; } navigator.clipboard .writeText(generatedHTML) .then(function () { document.getElementById( "message" ).textContent = "✓ ה־HTML הועתק"; }) .catch(function () { var textarea = document.createElement( "textarea" ); textarea.value = generatedHTML; document.body.appendChild( textarea ); textarea.select(); document.execCommand( "copy" ); document.body.removeChild( textarea ); document.getElementById( "message" ).textContent = "✓ ה־HTML הועתק"; }); } /* ========================= הורדה ========================= */ function downloadHTML() { if (!generatedHTML) { return; } var blob = new Blob( [generatedHTML], { type: "text/html;charset=utf-8" } ); var url = URL.createObjectURL(blob); var link = document.createElement("a"); link.href = url; link.download = "site.html"; document.body.appendChild( link ); link.click(); document.body.removeChild( link ); setTimeout( function () { URL.revokeObjectURL(url); }, 1000 ); }