From 423b01f703cd8562cf22143138f240d934f21acb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Allen=20Zhang=20=28=E5=BC=A0=E6=B6=9B=29?= Date: Sat, 20 Jul 2024 21:16:23 +0800 Subject: [PATCH] feat: update --- .../src/components/CanyonReport/ShikiDetail.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx b/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx index 6d9e265e..306e4ceb 100644 --- a/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx +++ b/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx @@ -102,14 +102,14 @@ const ShikiDetail = ({ defaultValue, filecoverage, theme }) => { .then((res) => { setContent(res); }) - .catch(() => { - console.log('覆盖率着色失败'); - // codeToHtml(defaultValue, { - // lang: 'javascript', - // theme: theme === 'light' ? 'light-plus' : 'tokyo-night', - // }).then((r) => { - // setContent(r); - // }); + .catch((err) => { + console.log('覆盖率着色失败', err); + codeToHtml(defaultValue, { + lang: 'javascript', + theme: theme === 'light' ? 'light-plus' : 'tokyo-night', + }).then((r) => { + setContent(r); + }); }); return (