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

superscript.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: b86906f01f2d298566429eaed1c3b6a2b43ec3e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { markInputRule } from '@tiptap/core';
import { Superscript } from '@tiptap/extension-superscript';
import { markInputRegex, extractMarkAttributesFromMatch } from '../services/mark_utils';

export default Superscript.extend({
  addInputRules() {
    return [
      markInputRule({
        find: markInputRegex('sup'),
        type: this.type,
        getAttributes: extractMarkAttributesFromMatch,
      }),
    ];
  },
});