Incorrect Task List syntax
Describe the bug When creating a tasklist with checkboxes, the markdown code of the note is being created inconsistent with GitHub Markdown Guide and Extended Syntax of Markdown Guide.
To Reproduce Steps to reproduce the behavior:
- Create a new file
- Open the file using NextCloud text
- Create Task List and wait until file is saved
- Open the Markdown code of the note.
- Each item in the list is displayed as
* [ ]but not as- [ ]
Also, a previously saved note with correct syntax is converted to invalid when it is re-saved.
Expected behavior
Each item in the Task List must begin with - [ ].
Text app version: 3.1.0
For uniformity we should probably just use the - dash for both lists and task lists exclusively, those are also the first recommendations of the basic guides for normal unordered lists.
Using * [ ] is perfectly valid GDM markdown according to https://github.github.com/gfm/#task-list-item-marker but I agree that using - is probably a nicer plaintext default.
This is directly rendered in Markdown by https://github.com/ProseMirror/prosemirror-markdown
https://github.com/ProseMirror/prosemirror-markdown/blob/af34ce60514afa8074fa32f82a08f622670a415d/src/to_markdown.ts#L83-L97
We must check how to change this default behavior in a good way.
We already have the option to change the default with the bullet parameter, and we also extend the rendering and have our custom toMarkdown methods:
src/nodes/TaskList.js
35: state.renderList(node, ' ', () => (node.attrs.bullet || '*') + ' ')
We already have the option to change the default with the bullet parameter, and we also extend the rendering and have our custom toMarkdown methods:
I've already tested it, but didn't work in my test, I can try more later.