Skip to content

Commit

Permalink
fix: highlight.js 控制台兼容性警告
Browse files Browse the repository at this point in the history
  • Loading branch information
Chanzhaoyu committed Mar 17, 2023
1 parent 9572484 commit a8e9a24
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/views/chat/components/Message/Text.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const mdi = new MarkdownIt({
const validLang = !!(language && hljs.getLanguage(language))
if (validLang) {
const lang = language ?? ''
return highlightBlock(hljs.highlight(lang, code, true).value, lang)
return highlightBlock(hljs.highlight(code, { language: lang }).value, lang)
}
return highlightBlock(hljs.highlightAuto(code).value, '')
},
Expand Down

0 comments on commit a8e9a24

Please sign in to comment.