[Server] Escape HTML in webchat (#2368)
* escape HTML in webchat * add amp
This commit is contained in:
parent
41c674161f
commit
c798308e3a
2 changed files with 130 additions and 119 deletions
|
@ -390,6 +390,9 @@
|
|||
// poor mans markdown replacement
|
||||
const Markdownish = (params) => {
|
||||
const md = params.text
|
||||
.replace(/&/g, '&')
|
||||
.replace(/</g, '<')
|
||||
.replace(/>/g, '>')
|
||||
.replace(/^#{1,6} (.*)$/gim, '<h3>$1</h3>')
|
||||
.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
|
||||
.replace(/__(.*?)__/g, '<strong>$1</strong>')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue