feat(image-captions): make footnotes work in image captions

This commit is contained in:
Jakob Schlanstedt 2025-04-28 16:08:05 +02:00
parent 971be65ba5
commit f10548a05c
2 changed files with 3 additions and 3 deletions

View File

@ -63,7 +63,7 @@ export default class InsertFootnoteCommand extends Command {
refresh() { refresh() {
const model = this.editor.model; const model = this.editor.model;
const lastPosition = model.document.selection.getLastPosition(); 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; this.isEnabled = allowedIn !== null;
} }
/** /**

View File

@ -76,7 +76,7 @@ export default class InsertFootnoteCommand extends Command {
public override refresh(): void { public override refresh(): void {
const model = this.editor.model; const model = this.editor.model;
const lastPosition = model.document.selection.getLastPosition(); 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; this.isEnabled = allowedIn !== null;
} }