mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-01 01:19:03 +08:00
b2ec51374d
* Adds attributes to toggleList When dealing with different variants of bullet lists, I wanted to adopt the same technique I used for different paragraph variants. Since `wrapInList` is capable of receiving attributes, just like `setNode` is, I don't see any reason why `toggleList` should not be capable of the same. Here's my bullet list extension in action that is in need of attributes support. ```js export const CustomBulletList = BulletList.extend({ content: 'listItem*', addAttributes() { return { variant: { default: DEFAULT_LIST, renderHTML: attributes => { return { class: `list-${attributes.variant}`, }; }, }, }; }, addCommands() { return { toggleBulletList: attributes => (c) => { return c.commands.toggleListCustom(this.name, this.options.itemTypeName, attributes); }, }; }, }); ``` * Update toggle-list.md * Update toggle-list.md |
||
---|---|---|
.. | ||
src | ||
CHANGELOG.md | ||
package.json | ||
README.md | ||
rollup.config.js |
@tiptap/core
Introduction
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.
Official Documentation
Documentation can be found on the tiptap website.
License
tiptap is open sourced software licensed under the MIT license.