mirror of
https://github.com/zadam/trilium.git
synced 2026-05-07 06:57:16 +02:00
fix(ckeditor5): internal link enabled in code block (closes #1712)
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user