From ccb7bd7f9701fc5def6cdd91becc3eda0733a108 Mon Sep 17 00:00:00 2001 From: libr Date: Mon, 1 Dec 2025 21:15:49 +0800 Subject: [PATCH] code --- src/components/notion/Code.astro | 152 ++++++++++++++++++++++--------- 1 file changed, 111 insertions(+), 41 deletions(-) diff --git a/src/components/notion/Code.astro b/src/components/notion/Code.astro index 0fe11b2..b358521 100644 --- a/src/components/notion/Code.astro +++ b/src/components/notion/Code.astro @@ -33,28 +33,38 @@ const code = block.Code.RichTexts.map( const language = block.Code.Language.toLowerCase() const grammer = Prism.languages[language.toLowerCase()] || Prism.languages.javascript +const displayLanguage = + language === 'plain text' ? 'TEXT' : language.toUpperCase() --- -
-
+
+
+
+ + + +
+
+ {displayLanguage} +
+
+ +
+
+
{ /* prettier-ignore */ language === 'mermaid' ? (
{code}
) : ( - <> -
- -
-
- +
) }
-
+