mirror of
https://github.com/hcengineering/platform.git
synced 2024-11-22 03:14:40 +03:00
UBERF-8079 Disable slash menu in codeblock (#6548)
Signed-off-by: Alexander Onnikov <Alexander.Onnikov@xored.com>
This commit is contained in:
parent
15fca07f96
commit
c236b90b6f
@ -14,8 +14,8 @@
|
||||
//
|
||||
|
||||
import { Extension } from '@tiptap/core'
|
||||
import Suggestion, { type SuggestionOptions } from './suggestion'
|
||||
import { PluginKey } from '@tiptap/pm/state'
|
||||
import Suggestion, { type SuggestionOptions } from './suggestion'
|
||||
|
||||
export interface InlineCommandsOptions {
|
||||
suggestion: Omit<SuggestionOptions, 'editor'>
|
||||
@ -31,7 +31,11 @@ export const InlineCommandsExtension = Extension.create<InlineCommandsOptions>({
|
||||
return {
|
||||
suggestion: {
|
||||
char: '/',
|
||||
startOfLine: true
|
||||
allow: ({ state }) => {
|
||||
const { $anchor } = state.selection
|
||||
const parent = $anchor.parent
|
||||
return parent.type.name === 'paragraph'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user