1
mirror of https://github.com/cocktailpeanut/dalai synced 2025-02-14 20:14:29 +01:00

Removed quote escape

Quote escaping was already added in another PR
This commit is contained in:
Pi 2023-03-17 22:54:49 -07:00 committed by GitHub
parent d12a5b5acd
commit d6217f1b69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -179,7 +179,7 @@ form.addEventListener('submit', (e) => {
e.preventDefault();
e.stopPropagation()
if (input.textContent) {
config.prompt = input.textContent.replaceAll("\n", "\\n").replaceAll('"', '\\\\\\""');
config.prompt = input.textContent.replaceAll("\n", "\\n");
config.id = "TS-" + Date.now() + "-" + Math.floor(Math.random() * 100000)
socket.emit('request', config)
config.id = null
@ -234,7 +234,6 @@ socket.on('result', async ({ request, response }) => {
existing.textContent = existing.textContent + response
existing.textContent = existing.textContent.replaceAll(/\r?\n\x1B\[\d+;\d+H./g, "");
existing.textContent = existing.textContent.replaceAll("\\n", "\n");
existing.textContent = existing.textContent.replaceAll('\\"', '"');
} else {
say(response, id)
}