From 175f49d135e8b9e98fecec54cd17453b77774398 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Wed, 1 Nov 2023 08:30:14 -0400 Subject: [PATCH] make fenced code blocks work with username modified: app.py modified: templates/chat.html --- app.py | 2 +- templates/chat.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 0528fb9..c2d32f5 100644 --- a/app.py +++ b/app.py @@ -111,7 +111,7 @@ def handle_message(data): emit( "message", - {"id": new_message.id, "content": f"{data['username']}: {data['message']}"}, + {"id": new_message.id, "content": f"{data['username']}:\n\n{data['message']}"}, room=data["room"], ) diff --git a/templates/chat.html b/templates/chat.html index 8f3738b..433a4cf 100644 --- a/templates/chat.html +++ b/templates/chat.html @@ -155,7 +155,7 @@ socket.on('previous_messages', (data) => { messageWrapper.id = "message-" + data.id; const newMessage = document.createElement('p'); - newMessage.innerHTML = marked.marked(`${data.username}: ${data.message}`); + newMessage.innerHTML = marked.marked(`${data.username}:\n\n${data.message}`); // Create the delete button const deleteButton = document.createElement('button');