Skip to content

Commit

Permalink
Update marked renderer params
Browse files Browse the repository at this point in the history
  • Loading branch information
Sensational-Code committed Aug 27, 2024
1 parent a7d59db commit 6b67931
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/ui/UserPortal/components/ChatMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down

0 comments on commit 6b67931

Please sign in to comment.