Skip to content

Commit e268a1f

Browse files
committed
chore: tweak memo content renderer
1 parent ac37738 commit e268a1f

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

web/src/components/MemoContent/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,11 @@ const MemoContent = (props: MemoContentProps) => {
5555
return <input {...inputProps} />;
5656
}) as React.ComponentType<React.ComponentProps<"input">>,
5757
span: ((spanProps: React.ComponentProps<"span"> & { node?: Element }) => {
58-
if (spanProps.node && isTagNode(spanProps.node)) {
58+
const { node, ...rest } = spanProps;
59+
if (node && isTagNode(node)) {
5960
return <Tag {...spanProps} />;
6061
}
61-
return <span {...spanProps} />;
62+
return <span {...rest} />;
6263
}) as React.ComponentType<React.ComponentProps<"span">>,
6364
pre: CodeBlock,
6465
a: ({ href, children, ...aProps }) => (

web/src/components/MemoView/components/metadata/AttachmentCard.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ interface AttachmentCardProps {
1111
const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps) => {
1212
const attachmentType = getAttachmentType(attachment);
1313
const sourceUrl = getAttachmentUrl(attachment);
14-
const colorspace = getColorspace(attachment.type);
1514

1615
if (attachmentType === "image/*") {
1716
return (
@@ -21,7 +20,6 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps)
2120
className={cn("w-full h-full object-cover rounded-lg cursor-pointer", className)}
2221
onClick={onClick}
2322
loading="lazy"
24-
{...(colorspace && { colorSpace: colorspace as unknown as string })}
2523
/>
2624
);
2725
}
@@ -33,7 +31,6 @@ const AttachmentCard = ({ attachment, onClick, className }: AttachmentCardProps)
3331
className={cn("w-full h-full object-cover rounded-lg", className)}
3432
controls
3533
preload="metadata"
36-
{...(colorspace && { colorSpace: colorspace as unknown as string })}
3734
/>
3835
);
3936
}

0 commit comments

Comments
 (0)