From b778c7e53ce2427a4ad1930954f75c865425e5ac Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Tue, 12 Dec 2023 12:14:13 -0500 Subject: [PATCH] modified: templates/chat.html --- templates/chat.html | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/chat.html b/templates/chat.html index d641f4f..5be4a6c 100644 --- a/templates/chat.html +++ b/templates/chat.html @@ -461,6 +461,9 @@ socket.on("message_updated", (data) => { messageContentContainer.innerHTML = DOMPurify.sanitize(marked.marked(data.content), dompurify_config); } + // Update the raw markdown stored in the data attribute + messageContentContainer.dataset.rawMarkdown = data.content; + // Apply syntax highlighting and other functionalities to code blocks within the message messageContentContainer.querySelectorAll("pre code").forEach((block) => { addCopyButtonToCodeBlock(block);