mirror of
https://github.com/hcengineering/platform.git
synced 2025-04-14 04:08:19 +00: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 { Extension } from '@tiptap/core'
|
||||||
import Suggestion, { type SuggestionOptions } from './suggestion'
|
|
||||||
import { PluginKey } from '@tiptap/pm/state'
|
import { PluginKey } from '@tiptap/pm/state'
|
||||||
|
import Suggestion, { type SuggestionOptions } from './suggestion'
|
||||||
|
|
||||||
export interface InlineCommandsOptions {
|
export interface InlineCommandsOptions {
|
||||||
suggestion: Omit<SuggestionOptions, 'editor'>
|
suggestion: Omit<SuggestionOptions, 'editor'>
|
||||||
@ -31,7 +31,11 @@ export const InlineCommandsExtension = Extension.create<InlineCommandsOptions>({
|
|||||||
return {
|
return {
|
||||||
suggestion: {
|
suggestion: {
|
||||||
char: '/',
|
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