mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-09-05 06:45:21 -04:00
[Server] Escape HTML in webchat (#2368)
* escape HTML in webchat * add amp
This commit is contained in:
@@ -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>')
|
||||
|
Reference in New Issue
Block a user