From 0761eaad1e5f15e8283c4043f4339093cba2c036 Mon Sep 17 00:00:00 2001 From: Arthals <36695271+zhuozhiyongde@users.noreply.github.com> Date: Sun, 3 Mar 2024 22:48:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20Add=20language=20support=20&=20fix:=20T?= =?UTF-8?q?ooltip=20now=20hides=20when=20scrolling=20to=E2=80=A6=20(#305)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: Add language support & fix: Tooltip now hides when scrolling to bottom * fix: use css control * fix: sort class * fix: single line copy overflow --- .../ui/code-highlighter/shiki/Shiki.tsx | 38 ++++++++++++------- .../ui/code-highlighter/shiki/utils.tsx | 9 +++++ 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/components/ui/code-highlighter/shiki/Shiki.tsx b/src/components/ui/code-highlighter/shiki/Shiki.tsx index 98d6f3d4af..08a52e77ca 100644 --- a/src/components/ui/code-highlighter/shiki/Shiki.tsx +++ b/src/components/ui/code-highlighter/shiki/Shiki.tsx @@ -63,6 +63,10 @@ export const ShikiHighLighter: FC = (props) => { () => import('shiki/langs/markdown.mjs'), () => import('shiki/langs/vue.mjs'), () => import('shiki/langs/html.mjs'), + () => import('shiki/langs/asm.mjs'), + () => import('shiki/langs/bash.mjs'), + () => import('shiki/langs/ps.mjs'), + () => import('shiki/langs/ps1.mjs'), ], loadWasm: getWasm, }) @@ -114,7 +118,7 @@ export const ShikiHighLighter: FC = (props) => { return (
{!!filename && ( -
+
{filename} = (props) => {
{language.toUpperCase()}
)} -
+
+ + + - - -
= (props) => {
{isOverflow && isCollapsed && ( -
+