debian-mirror-gitlab/app/assets/javascripts/content_editor/extensions/highlight.js
2023-01-12 18:35:48 +00:00

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 [];
},
});