From a827a6dec88e61e20e307bfcafb8f9eb0447ed92 Mon Sep 17 00:00:00 2001 From: Jonas Date: Thu, 14 Mar 2024 19:43:38 +0100 Subject: [PATCH] fix(LinkPicker): Don't open link picker inside code blocks Fixes: #5381 Signed-off-by: Jonas --- src/extensions/LinkPicker.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/extensions/LinkPicker.js b/src/extensions/LinkPicker.js index 76bde07a408..d399ee2bdbe 100644 --- a/src/extensions/LinkPicker.js +++ b/src/extensions/LinkPicker.js @@ -14,6 +14,10 @@ export default Extension.create({ char: '/', allowedPrefixes: [' '], pluginKey: LinkPickerPluginKey, + allow: ({ state, range }) => { + const $from = state.doc.resolve(range.from) + return $from.parent.type.name !== 'codeBlock' + }, ...suggestions(), }, }