From f4bd302e9d47e31a91ea62afc3710812899652df Mon Sep 17 00:00:00 2001 From: wangjiacai Date: Mon, 3 Apr 2023 23:54:25 +0800 Subject: [PATCH] fix tag escape --- project/templates/chat.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/project/templates/chat.html b/project/templates/chat.html index 3efdfe9..48c041e 100644 --- a/project/templates/chat.html +++ b/project/templates/chat.html @@ -53,11 +53,11 @@ li.style.marginBottom = "20px" if (msg.response == "" && msg.request != "") { li.style.textAlign = "right" - pre.innerHTML = msg.request + pre.innerText = msg.request pre.style.backgroundColor = "lightblue" } else if (msg.request != "") { li.style.textAlign = "left" - pre.innerHTML = msg.response + pre.innerText = msg.response pre.style.backgroundColor = "lightgreen" } pre.style.borderRadius = "10px" @@ -84,7 +84,7 @@ li.appendChild(pre) li.style.textAlign="right" li.style.marginBottom="20px" - pre.innerHTML=data.msg + pre.innerText=data.msg pre.style.backgroundColor="lightblue" pre.style.borderRadius="10px" pre.style.padding="5px"