Skip to content

Commit ffd4ba0

Browse files
修复markdown复制的内容不正确
1 parent c4d758b commit ffd4ba0

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/contestEditor/configPanel.tsx

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -620,16 +620,18 @@ const ConfigPanel: FC<{
620620
type="text"
621621
icon={<FontAwesomeIcon icon={faMarkdown} />}
622622
onClick={() =>
623-
navigator.clipboard.writeText(img.url).then(
624-
() => message.success("复制成功"),
625-
(e) => {
626-
console.error("Error when copy.", e);
627-
message.error(
628-
"复制失败:" +
629-
(e instanceof Error ? e.message : String(e)),
630-
);
631-
},
632-
)
623+
navigator.clipboard
624+
.writeText(`![${img.name}](${img.url})`)
625+
.then(
626+
() => message.success("复制成功"),
627+
(e) => {
628+
console.error("Error when copy.", e);
629+
message.error(
630+
"复制失败:" +
631+
(e instanceof Error ? e.message : String(e)),
632+
);
633+
},
634+
)
633635
}
634636
/>
635637
<Button

0 commit comments

Comments
 (0)