debian-mirror-gitlab/app/assets/javascripts/content_editor/extensions/highlight.js
2023-01-13 15:02:22 +05:30

19 lines
467 B
JavaScript

import { markInputRule } from '@tiptap/core';
import { Highlight } from '@tiptap/extension-highlight';
import { markInputRegex, extractMarkAttributesFromMatch } from '../services/mark_utils';
export default Highlight.extend({
addInputRules() {
return [
markInputRule({
find: markInputRegex('mark'),
type: this.type,
getAttributes: extractMarkAttributesFromMatch,
}),
];
},
addPasteRules() {
return [];
},
});