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

Commit

Permalink
fix: get the wrong link after selecting an attachment (#893)
Browse files Browse the repository at this point in the history
#### 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
```
  • Loading branch information
ruibaby authored Feb 28, 2023
1 parent e3e0ddc commit 3d718b5
Showing 1 changed file with 1 addition and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -314,11 +314,7 @@ export function useAttachmentSelect(
})
.filter(Boolean) as Content[];

editor.value
?.chain()
.focus()
.insertContent([...contents, { type: "paragraph", content: "" }])
.run();
editor.value?.chain().focus().insertContent(contents).run();
};

return {
Expand Down

1 comment on commit 3d718b5

@vercel
Copy link

@vercel vercel bot commented on 3d718b5 Feb 28, 2023

Choose a reason for hiding this comment

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

Successfully deployed to the following URLs:

ui – ./

ui-git-main-halo-dev.vercel.app
ui-halo-dev.vercel.app
halo-admin-ui.vercel.app

Please sign in to comment.