From c86fe3bb1941a992081e44d76073bcb47aed03d9 Mon Sep 17 00:00:00 2001 From: Alexey Suprun Date: Mon, 28 Oct 2024 11:16:45 +0100 Subject: [PATCH 1/2] feat: show line number for code snippet --- sanity/components/codeHighlighter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sanity/components/codeHighlighter.tsx b/sanity/components/codeHighlighter.tsx index 9488bbe..e87d0a7 100644 --- a/sanity/components/codeHighlighter.tsx +++ b/sanity/components/codeHighlighter.tsx @@ -5,7 +5,7 @@ const codeHighlighter = ({ value }: { value: { language?: string; code?: string if (value?.language && value?.code) { return (
- + {value.code}
From fdd0da138fc8d9de277c813fc74cd67fc436ac8c Mon Sep 17 00:00:00 2001 From: Alexey Suprun Date: Mon, 28 Oct 2024 19:48:49 +0100 Subject: [PATCH 2/2] fix: fix undefined return on code highlighter component's error --- sanity/components/codeHighlighter.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/sanity/components/codeHighlighter.tsx b/sanity/components/codeHighlighter.tsx index e87d0a7..208bf38 100644 --- a/sanity/components/codeHighlighter.tsx +++ b/sanity/components/codeHighlighter.tsx @@ -11,6 +11,7 @@ const codeHighlighter = ({ value }: { value: { language?: string; code?: string ); } + return <>; }; export default codeHighlighter;