Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

editor: do not add data-block-id attribute if no blockid

Abdullah Attac8bf1fc2cd60
diff --git a/packages/editor/src/extensions/block-id/block-id.ts b/packages/editor/src/extensions/block-id/block-id.ts
index 511ebc0f4..b7cc41a9c 100644
--- a/packages/editor/src/extensions/block-id/block-id.ts
+++ b/packages/editor/src/extensions/block-id/block-id.ts
@@ -53,6 +53,7 @@ export const BlockId = Extension.create({
return id || null;
},
renderHTML: (attributes) => {
+ if (!attributes?.blockId) return {};
return {
"data-block-id": attributes?.blockId
};