# Adding support in markdown (GFM) to continue TaskList markup

**URL:** <https://discuss.codemirror.net/t/adding-support-in-markdown-gfm-to-continue-tasklist-markup/3803>\
**Category:** v6\
**Created:** [December 13, 2021, 6:02am UTC](https://discuss.codemirror.net/t/adding-support-in-markdown-gfm-to-continue-tasklist-markup/3803 "2021-12-13T06:02:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![acnebs](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/acnebs/32/1684_2.png) [@acnebs](https://discuss.codemirror.net/u/acnebs)\
**Post date:** [December 13, 2021, 6:02am UTC](https://discuss.codemirror.net/t/adding-support-in-markdown-gfm-to-continue-tasklist-markup/3803/1 "2021-12-13T06:02:18Z")

</div>

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:

```nohighlight
BulletList > ListItem

```

The structure of a TaskList is actually:

```nohighlight
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:

```nohighlight
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?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)\
**Post date:** [December 13, 2021, 7:34am UTC](https://discuss.codemirror.net/t/adding-support-in-markdown-gfm-to-continue-tasklist-markup/3803/2 "2021-12-13T07:34:05Z")

</div>

One possible direction would be to add node props to your syntax nodes that signal how the commands should behave, and write those commands without hard-coding node types. If that turns out to work very well, I’d be interested in seeing if it’d be appropriate for the lang-markdown implementation as well.
