fix: prevent anonymous extensions from being filtered due to duplicate 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
解决默认编辑器附件库无法被打开的问题
```
pull/6555/head
Takagi 2024-08-29 17:07:25 +08:00 committed by GitHub
parent 5bd6d910f2
commit 9c9ac1b38f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -254,6 +254,7 @@ const presetExtensions = [
ExtensionColor,
ExtensionIndent,
Extension.create({
name: "custom-heading-extension",
addGlobalAttributes() {
return [
{
@ -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"])) {
@ -342,6 +344,7 @@ const presetExtensions = [
ExtensionNodeSelected,
ExtensionTrailingNode,
Extension.create({
name: "get-heading-id-extension",
addProseMirrorPlugins() {
return [
new Plugin({