Skip to content

Commit

Permalink
fix(LinkPicker): Don't open link picker inside code blocks
Browse files Browse the repository at this point in the history
Fixes: #5381

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- committed Mar 14, 2024
1 parent e61a6da commit e66ccc0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/extensions/LinkPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
},
}
Expand Down

0 comments on commit e66ccc0

Please sign in to comment.