gitlab-org--gitlab-foss/app/assets/javascripts/content_editor/extensions/bullet_list.js

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

20 lines
448 B
JavaScript
Raw Permalink Normal View History

import { BulletList } from '@tiptap/extension-bullet-list';
import { getMarkdownSource } from '../services/markdown_sourcemap';
export default BulletList.extend({
addAttributes() {
return {
...this.parent?.(),
bullet: {
default: '*',
parseHTML(element) {
const bullet = getMarkdownSource(element)?.charAt(0);
return '*+-'.includes(bullet) ? bullet : '*';
},
},
};
},
});