aboutsummaryrefslogtreecommitdiff
path: root/examples/server/public/index.html
diff options
context:
space:
mode:
authorHenri Vasserman <henv@hot.ee>2023-07-25 10:27:34 +0300
committerGitHub <noreply@github.com>2023-07-25 10:27:34 +0300
commitc798308e3a425eae050a1f249a576fa8c6433327 (patch)
tree3eade5ade6a698017ccf1bd325b3705027000480 /examples/server/public/index.html
parent41c674161fb2459bdf7806d1eebead15bc5d046e (diff)
[Server] Escape HTML in webchat (#2368)
* escape HTML in webchat * add amp
Diffstat (limited to 'examples/server/public/index.html')
-rw-r--r--examples/server/public/index.html3
1 files changed, 3 insertions, 0 deletions
diff --git a/examples/server/public/index.html b/examples/server/public/index.html
index f5ed2d4..ea93de4 100644
--- a/examples/server/public/index.html
+++ b/examples/server/public/index.html
@@ -390,6 +390,9 @@
// poor mans markdown replacement
const Markdownish = (params) => {
const md = params.text
+ .replace(/&/g, '&amp;')
+ .replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
.replace(/^#{1,6} (.*)$/gim, '<h3>$1</h3>')
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
.replace(/__(.*?)__/g, '<strong>$1</strong>')