diff --git a/src/index.ts b/src/index.ts index fc01853..1501d20 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1094,11 +1094,10 @@ export default class PluginFootnote extends Plugin { const renderedTemplate = await renderTemplates(templates); // Update block content - + const existingAttrs = await getBlockAttrs(newBlockId); await updateBlock("markdown", renderedTemplate, newBlockId); - // Restore block attributes that could have been reset by updateBlock - const existingAttrs = await getBlockAttrs(newBlockId); + if (existingAttrs) { await setBlockAttrs(newBlockId, { "custom-plugin-footnote-content": existingAttrs["custom-plugin-footnote-content"],