Skip to content

Commit

Permalink
fix: prevent anonymous extensions from being filtered due to duplicat…
Browse files Browse the repository at this point in the history
…e names (#6548)

#### What type of PR is this?

/kind bug
/area editor
/milestone 2.19.x

#### What this PR does / why we need it:

为匿名的 `Extension` 添加 name 值,解决由于匿名的 `Extension` name 相同而导致被过滤的问题。

#### How to test it?

测试默认编辑器附件库是否可以被打开。

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器附件库无法被打开的问题
```
  • Loading branch information
LIlGG authored Aug 29, 2024
1 parent 5bd6d91 commit 9c9ac1b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ui/src/components/editor/DefaultEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ const presetExtensions = [
ExtensionColor,
ExtensionIndent,
Extension.create({
name: "custom-heading-extension",
addGlobalAttributes() {
return [
{
Expand All @@ -268,6 +269,7 @@ const presetExtensions = [
},
}),
Extension.create({
name: "custom-attachment-extension",
addOptions() {
// If user has no permission to view attachments, return
if (!currentUserHasPermission(["system:attachments:view"])) {
Expand Down Expand Up @@ -342,6 +344,7 @@ const presetExtensions = [
ExtensionNodeSelected,
ExtensionTrailingNode,
Extension.create({
name: "get-heading-id-extension",
addProseMirrorPlugins() {
return [
new Plugin({
Expand Down

0 comments on commit 9c9ac1b

Please sign in to comment.