$1")
.replace(/^###\s*(.*)$/gm, "" ).replace(/\n/g, "
" ); return "
" + text + "
" ; } chatInput.addEventListener("input", ()=> { chatInput.style.height = "auto"; chatInput.style.height = Math.min(chatInput.scrollHeight, 128) + "px"; }); chatInput.addEventListener("keydown", (e) => { if (e.key === "Enter" && !e.shiftKey) { e.preventDefault(); chatForm.dispatchEvent(new Event("submit", { cancelable: true, bubbles: true })); } });