Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.

Commit b1722f1

Browse files
committed
fix(markdown): show copy to clipboard when lang is detected
1 parent a336308 commit b1722f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Markdown.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function Markdown({ children, isInverted = false }: Props) {
6666
const language = match ? match[1] : detectedLanguage;
6767
return (
6868
<div
69-
className="relative group w-full ml-0 my-4"
69+
className="relative group w-full ml-0"
7070
data-testid="syntax-highlighter"
7171
>
7272
<SyntaxHighlighter
@@ -79,7 +79,7 @@ export function Markdown({ children, isInverted = false }: Props) {
7979
>
8080
{String(children).replace(/\n$/, "")}
8181
</SyntaxHighlighter>
82-
{match && (
82+
{language && (
8383
<CopyToClipboard
8484
text={String(children).replace(/\n$/, "")}
8585
className="absolute top-4 right-8"

0 commit comments

Comments
 (0)