Skip to content
This repository was archived by the owner on Jan 21, 2024. It is now read-only.

Commit 3d718b5

Browse files
authored
fix: get the wrong link after selecting an attachment (#893)
#### What type of PR is this? /kind bug #### What this PR does / why we need it: 修复默认编辑器从附件库选择非图片、音视频的附件,以链接的形式插入之后得到的链接不正确的问题。 #### Which issue(s) this PR fixes: Fixes halo-dev/halo#3408 #### Screenshots: before: <img width="995" alt="image" src="https://user-images.githubusercontent.com/21301288/221510856-76eaa125-c13e-472a-8073-7f9f58bb4bd2.png"> after: <img width="924" alt="image" src="https://user-images.githubusercontent.com/21301288/221510749-c27fc083-3978-4139-959a-426499016d12.png"> #### Special notes for your reviewer: 测试方式: 1. 上传若干 zip 格式附件。 2. 在编辑器中选择这些附件并插入,检查链接是否正确。 #### Does this PR introduce a user-facing change? ```release-note None ```
1 parent e3e0ddc commit 3d718b5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/modules/contents/attachments/composables/use-attachment.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,7 @@ export function useAttachmentSelect(
314314
})
315315
.filter(Boolean) as Content[];
316316

317-
editor.value
318-
?.chain()
319-
.focus()
320-
.insertContent([...contents, { type: "paragraph", content: "" }])
321-
.run();
317+
editor.value?.chain().focus().insertContent(contents).run();
322318
};
323319

324320
return {

0 commit comments

Comments
 (0)