Task list support #42

Open
opened 2020-07-14 19:49:01 +02:00 by iamcarbon · 2 comments
iamcarbon commented 2020-07-14 19:49:01 +02:00 (Migrated from github.com)

It would be useful to support the task list extension in the library (used by GitHUB and others). Happy to sponsor the time on the work if this is a feature the library would accept.

Here's the specification.

https://docs.github.com/en/github/managing-your-work-on-github/about-task-lists

- [x] Finish my changes
- [ ] Push my commits to GitHub
- [ ] Open a pull request
It would be useful to support the task list extension in the library (used by GitHUB and others). Happy to sponsor the time on the work if this is a feature the library would accept. Here's the specification. https://docs.github.com/en/github/managing-your-work-on-github/about-task-lists ``` - [x] Finish my changes - [ ] Push my commits to GitHub - [ ] Open a pull request ```
ocavue commented 2020-07-14 20:33:37 +02:00 (Migrated from github.com)

You can check my implementation here: github.com/ocavue/rino@5136c00f17/packages/web/src/editor/extensions/list/list-extension.ts (L199)

it's written in typescript and remirror so the code can't be copy directly into Prosemirror-Mardkown, but you should get the idea easily.

You can check my implementation here: https://github.com/ocavue/rino/blob/5136c00f17365ebd8d8f43c45a627780401b1476/packages/web/src/editor/extensions/list/list-extension.ts#L199 it's written in typescript and [remirror](https://github.com/remirror/remirror) so the code can't be copy directly into Prosemirror-Mardkown, but you should get the idea easily.
neaumusic commented 2024-08-28 02:26:50 +02:00 (Migrated from github.com)
    taskList(state, node, parent, index) {
      state.renderList(node, '  ', i => (node.child(i).attrs.checked ? '- [x] ' : '- [ ] '))
    },

this may be all thats needed, haven't tested it thoroughly, but taskList is the node name from my doc.type.schema

``` taskList(state, node, parent, index) { state.renderList(node, ' ', i => (node.child(i).attrs.checked ? '- [x] ' : '- [ ] ')) }, ``` this may be all thats needed, haven't tested it thoroughly, but taskList is the node name from my doc.type.schema
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
prosemirror/prosemirror-markdown#42
No description provided.