1 2 3 4 5 6 7 8 9
// Small shared helpers for the console UI. /** Escape a string for safe interpolation into innerHTML. */ export function escapeHtml(s) { return String(s ?? "").replace( /[&<>"]/g, (c) => ({ "&": "&", "<": "<", ">": ">", '"': """ })[c], ); }