diff --git a/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx b/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx index 7a44acbe..faae4fd3 100644 --- a/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx +++ b/packages/canyon-platform/src/components/CanyonReport/ShikiDetail.tsx @@ -98,9 +98,19 @@ const ShikiDetail = ({ defaultValue, filecoverage, theme }) => { properties: { class: 'content-class-no-found' }, }; }), - }).then((res) => { - setContent(res); - }); + }) + .then((res) => { + setContent(res); + }) + .catch(() => { + console.log('覆盖率着色失败'); + codeToHtml(defaultValue, { + lang: 'javascript', + theme: theme === 'light' ? 'light-plus' : 'tokyo-night', + }).then((r) => { + setContent(r); + }); + }); return (