Hi, I’m using the GFM configuration for @codemirror/markdown-lang
and noticed that while lists (both ordered and unordered) will automatically continue thanks to the insertNewlineContinueMarkup()
function, this function unfortunately does not support auto-continuing TaskLists.
As I could not see any way to “extend” this function I just started to rewrite it. Unfortunately I’m having a little trouble parsing exactly what everything is doing in those functions. Specifically I’m not entirely sure I understand the necessity of the interactions between the insertNewlineContinueMarkup()
function and the getContext()
function.
Part of the problem I think is that while the structure of the other lists is:
BulletList > ListItem
The structure of a TaskList is actually:
BulletList > ListItem > Task
And most of the code is structure around that two-layer assumption rather than three. So at this point I’m unsure if the solution is to change the parser to no longer consider the Task
just some level below a “normal” list and have it be something like:
TaskList > Task (or potentially this could also just be a ListItem?)
or if I should instead just figure out how to make the markdown functions play nicely with the fact that Task’s are actually just below a normal list.
Any guidance / thoughts?