debian-mirror-gitlab/app/assets/javascripts/content_editor/extensions/subscript.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
425 B
JavaScript
Raw Normal View History

2021-11-11 11:23:49 +05:30
import { markInputRule } from '@tiptap/core';
import { Subscript } from '@tiptap/extension-subscript';
import { markInputRegex, extractMarkAttributesFromMatch } from '../services/mark_utils';
export default Subscript.extend({
addInputRules() {
2021-12-11 22:18:48 +05:30
return [
markInputRule({
find: markInputRegex('sub'),
type: this.type,
getAttributes: extractMarkAttributesFromMatch,
}),
];
2021-11-11 11:23:49 +05:30
},
});