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

10 lines
350 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() {
return [markInputRule(markInputRegex('sub'), this.type, extractMarkAttributesFromMatch)];
},
});