Skip to content

Build your personal knowledge base with Trilium Notes

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

Jakob Schlanstedtf10548a05c02
diff --git a/src/insert-footnote-command.js b/src/insert-footnote-command.js
index 9aa0b0b3b0..30ffeb7bee 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 bb025815f8..e7dde06828 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;
}