From 6b67931d66ab793bd145c500dbc55fbcb3cdfdf9 Mon Sep 17 00:00:00 2001 From: Sensational Code Date: Tue, 27 Aug 2024 08:01:56 -0700 Subject: [PATCH] Update marked renderer params --- src/ui/UserPortal/components/ChatMessage.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/UserPortal/components/ChatMessage.vue b/src/ui/UserPortal/components/ChatMessage.vue index f0f8574189..76a9180073 100644 --- a/src/ui/UserPortal/components/ChatMessage.vue +++ b/src/ui/UserPortal/components/ChatMessage.vue @@ -176,8 +176,9 @@ import CodeBlockHeader from '@/components/CodeBlockHeader.vue'; import ChatMessageContentBlock from '@/components/ChatMessageContentBlock.vue'; const renderer = new marked.Renderer(); -renderer.code = (code, language) => { - const sourceCode = code.raw || code; +renderer.code = (code) => { + const language = code.lang; + const sourceCode = code.text || code; const validLanguage = !!(language && hljs.getLanguage(language)); const highlighted = validLanguage ? hljs.highlight(sourceCode, { language })