Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@tiptap/extension-task-list
Advanced tools
@tiptap/extension-task-list is an extension for the Tiptap editor that allows you to add and manage task lists within your rich text editor. It provides functionality to create, edit, and manage task lists, making it easier to handle to-do lists and similar content within your editor.
Create Task List
This code demonstrates how to create a task list using the @tiptap/extension-task-list package. It initializes the Tiptap editor with the TaskList and TaskItem extensions and sets the initial content to a task list with two items.
import TaskList from '@tiptap/extension-task-list';
import TaskItem from '@tiptap/extension-task-item';
import { Editor } from '@tiptap/core';
const editor = new Editor({
extensions: [
TaskList,
TaskItem,
],
content: '<ul data-type="taskList"><li data-checked="false">Task 1</li><li data-checked="true">Task 2</li></ul>',
});
Toggle Task Completion
This code demonstrates how to toggle the completion status of a task item within a task list. The `toggleTaskItem` method is used to change the checked state of a task item.
editor.chain().focus().toggleTaskItem({ id: 'task-item-id' }).run();
Add New Task Item
This code demonstrates how to add a new task item to an existing task list. The `insertContent` method is used to insert a new task item with the specified content.
editor.chain().focus().insertContent('<li data-type="taskItem" data-checked="false">New Task</li>').run();
Tiptap is a headless wrapper around ProseMirror – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as New York Times, The Guardian or Atlassian.
Documentation can be found on the Tiptap website.
Tiptap is open sourced software licensed under the MIT license.
FAQs
task list extension for tiptap
We found that @tiptap/extension-task-list demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.