Skip to content

Commit

Permalink
Merge pull request #5490 from nextcloud/fix/no_linkpicker_in_codeblock
Browse files Browse the repository at this point in the history
fix(LinkPicker): Don't open link picker inside code blocks
  • Loading branch information
mejo- committed Mar 14, 2024
2 parents e61a6da + e66ccc0 commit ebd320f
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 ebd320f

Please sign in to comment.