From f10548a05c0237c4ac70f2860fbf8deffdd3f000 Mon Sep 17 00:00:00 2001 From: Jakob Schlanstedt Date: Mon, 28 Apr 2025 16:08:05 +0200 Subject: [PATCH] feat(image-captions): make footnotes work in image captions --- src/insert-footnote-command.js | 4 ++-- src/insert-footnote-command.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/insert-footnote-command.js b/src/insert-footnote-command.js index 9aa0b0b3b..30ffeb7be 100644 --- a/src/insert-footnote-command.js +++ b/src/insert-footnote-command.js @@ -63,7 +63,7 @@ export default class InsertFootnoteCommand extends Command { refresh() { const model = this.editor.model; const lastPosition = model.document.selection.getLastPosition(); - const allowedIn = lastPosition && model.schema.findAllowedParent(lastPosition, ELEMENTS.footnoteSection); + const allowedIn = lastPosition && model.schema.findAllowedParent(lastPosition, ELEMENTS.footnoteReference); this.isEnabled = allowedIn !== null; } /** @@ -79,4 +79,4 @@ export default class InsertFootnoteCommand extends Command { return newFootnoteSection; } } -//# sourceMappingURL=insert-footnote-command.js.map \ No newline at end of file +//# sourceMappingURL=insert-footnote-command.js.map diff --git a/src/insert-footnote-command.ts b/src/insert-footnote-command.ts index bb025815f..e7dde0682 100644 --- a/src/insert-footnote-command.ts +++ b/src/insert-footnote-command.ts @@ -76,7 +76,7 @@ export default class InsertFootnoteCommand extends Command { public override refresh(): void { const model = this.editor.model; const lastPosition = model.document.selection.getLastPosition(); - const allowedIn = lastPosition && model.schema.findAllowedParent( lastPosition, ELEMENTS.footnoteSection ); + const allowedIn = lastPosition && model.schema.findAllowedParent( lastPosition, ELEMENTS.footnoteReference ); this.isEnabled = allowedIn !== null; }