fix(ckeditor5): internal link enabled in code block (closes #1712)

This commit is contained in:
Elian Doran
2026-04-11 10:41:24 +03:00
parent 9366d351e0
commit 1becc18354

View File

@@ -39,7 +39,11 @@ export default class InternalLinkPlugin extends Plugin {
class InsertInternalLinkCommand extends Command {
refresh() {
this.isEnabled = !this.editor.isReadOnly;
const selection = this.editor.model.document.selection;
const position = selection.getFirstPosition();
const isInCodeBlock = position?.findAncestor("codeBlock");
this.isEnabled = !this.editor.isReadOnly && !isInCodeBlock;
}
execute() {