Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions website/src/components/releases/release-list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,20 +100,22 @@ export function ReleaseItem({ release, isLatest }: ReleaseItemProps) {
<ReactMarkdown
remarkPlugins={[remarkGfm]}
components={{
code({ inline, className, children, ...props }) {
code(props) {
const { children, className, ...rest } = props;
const match = /language-(\w+)/.exec(className || '');
return !inline && match ? (
const isInline = !match;

return !isInline && match ? (
Comment on lines +106 to +108

Copilot AI Dec 7, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The isInline variable and the condition !isInline && match could be simplified. Since isInline = !match, the condition !isInline && match is equivalent to just checking match. Consider simplifying to:

const match = /language-(\w+)/.exec(className || '');

return match ? (
  // block code with syntax highlighting
) : (
  // inline code
);

This makes the logic clearer and removes the unnecessary intermediate variable.

Suggested change
const isInline = !match;
return !isInline && match ? (
return match ? (

Copilot uses AI. Check for mistakes.
<SyntaxHighlighter
style={oneDark}
style={oneDark as { [key: string]: React.CSSProperties }}
language={match[1]}
PreTag="div"
className="rounded-lg !mt-2 !mb-4"
{...props}
>
{String(children).replace(/\n$/, '')}
</SyntaxHighlighter>
) : (
<code className={className} {...props}>
<code className={className} {...rest}>
{children}
</code>
);
Expand Down
1 change: 1 addition & 0 deletions website/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

Loading