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

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

20 lines
467 B
JavaScript
Raw Normal View History

2023-01-13 00:05:48 +05:30
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 [];
},
});