mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-12 08:49:04 +08:00
1.7 KiB
1.7 KiB
OrderedList
This extension enables you to use ordered lists in the editor. They are rendered as <ol>
HTML tags.
Type 1.
(or any other number followed by a dot) at the beginning of a new line and it will magically transform to a ordered list.
Installation
# with npm
npm install @tiptap/extension-ordered-list @tiptap/extension-list-item
# with Yarn
yarn add @tiptap/extension-ordered-list @tiptap/extension-list-item
This extension requires the ListItem
node.
Settings
HTMLAttributes
Custom HTML attributes that should be added to the rendered HTML tag.
OrderedList.configure({
HTMLAttributes: {
class: 'my-custom-class',
},
})
Commands
Command | Parameters | Description |
---|---|---|
orderedList | — | Toggle an ordered list. |
Keyboard shortcuts
Command | Windows/Linux | macOS |
---|---|---|
toggleOrderedList | Control Shift 7 |
Cmd Shift 7 |
Source code
packages/extension-ordered-list/