From d57ee512234c5e44517e3fb276a3be6fb3cd1dd8 Mon Sep 17 00:00:00 2001 From: yaokailun Date: Wed, 25 Sep 2024 04:38:26 +0800 Subject: [PATCH] fix(core): filter rendered extensionAttributes (#5588) --- .changeset/tricky-apricots-smash.md | 5 +++++ packages/core/src/helpers/getRenderedAttributes.ts | 3 +++ 2 files changed, 8 insertions(+) create mode 100644 .changeset/tricky-apricots-smash.md diff --git a/.changeset/tricky-apricots-smash.md b/.changeset/tricky-apricots-smash.md new file mode 100644 index 000000000..c56f556ae --- /dev/null +++ b/.changeset/tricky-apricots-smash.md @@ -0,0 +1,5 @@ +--- +"@tiptap/core": patch +--- + +filter rendered extensionAttributes (#5588) diff --git a/packages/core/src/helpers/getRenderedAttributes.ts b/packages/core/src/helpers/getRenderedAttributes.ts index 5dd0855a2..fd85e699a 100644 --- a/packages/core/src/helpers/getRenderedAttributes.ts +++ b/packages/core/src/helpers/getRenderedAttributes.ts @@ -8,6 +8,9 @@ export function getRenderedAttributes( extensionAttributes: ExtensionAttribute[], ): Record { return extensionAttributes + .filter( + attribute => attribute.type === nodeOrMark.type.name, + ) .filter(item => item.attribute.rendered) .map(item => { if (!item.attribute.renderHTML) {