Removing the default paragraph (p) inside a list item (li)

I was able to resolve this by extending the ListItem.

First, get ListItem

import ListItem from '@tiptap/extension-list-item';

next, extend it by setting it to only allow text content (Turns out there are schemas that set what can go in a node)

const CustomListItem = ListItem.extend({
    content: 'text*'
});

Finally, add it in:

mounted() {
  this.editor = new Editor({
    extensions: [
      StarterKit.configure({
        history: true,
      }),
      CustomListItem,
    ],
  });
}
1 Like