modified: templates/chat.html

This commit is contained in:
Russell Ballestrini 2023-12-12 12:14:13 -05:00
parent 31a2f306e1
commit b778c7e53c

View file

@ -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);