mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-23 02:06:29 -05:00
fix: prevent emoji autocomplete
Add an empty entry to the emoji autocompletion which allows us to press enter to continue without any random emojis in the note where we did not intend them. Fixes #5251 Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
994b159618
commit
48ced674e7
1 changed files with 10 additions and 8 deletions
|
@ -28,14 +28,16 @@ export class EmojiAppExtension extends AppExtension {
|
|||
}
|
||||
|
||||
buildAutocompletion(): CompletionSource[] {
|
||||
return [
|
||||
regexCompletion(
|
||||
/:(?:[\w-+]+:?)?/,
|
||||
emojiShortcodes.map((shortcode) => ({
|
||||
const completions = [
|
||||
{
|
||||
detail: '',
|
||||
label: ':'
|
||||
},
|
||||
...emojiShortcodes.map((shortcode) => ({
|
||||
detail: t('editor.autocompletions.emoji') ?? undefined,
|
||||
label: `:${shortcode}:`
|
||||
}))
|
||||
)
|
||||
]
|
||||
return [regexCompletion(/:(?:[\w-+]+:?)?/, completions)]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue