Welcome to mirror list, hosted at ThFree Co, Russian Federation.

code.js « extensions « content_editor « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8477c8dbd287e532a14bfd45ee5d64460ee2973e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Mark } from '@tiptap/core';
import Code from '@tiptap/extension-code';
import { EXTENSION_PRIORITY_LOWER } from '../constants';

export default Code.extend({
  excludes: null,

  /**
   * Reduce the rendering priority of the code mark to
   * ensure the bold, italic, and strikethrough marks
   * are rendered first.
   */
  priority: EXTENSION_PRIORITY_LOWER,

  addKeyboardShortcuts() {
    return {
      ArrowRight: () => {
        return Mark.handleExit({ editor: this.editor, mark: this });
      },
    };
  },
});