micromark / common-markup-state-machine

CMSM: Common markup state machine
https://unifiedjs.com
48 stars 0 forks source link

GFM extension: task lists #9

Closed wooorm closed 3 years ago

wooorm commented 4 years ago

In GFM, phrasing, when inside a list item, can render a new construct at its start, namely a checkbox!

This gets interesting, because the phrasing can be preceded by definitions.

I’ll use separate comments because there is a way to turn off checked checkboxes! 🙄

Exhibit A (definitions):

- [y]: a
  [x] foo
wooorm commented 4 years ago

Exhibit B (setext headings):

- [x] foo
  -------

Note that checkboxes don’t work in setext headings

wooorm commented 4 years ago

Exhibit C (turning off checkboxes):

- [x] foo

[x]: a

^-- look at that! Checked checkboxes no longer work.

wooorm commented 4 years ago

It is interesting to me that there are a couple of things that only work at the start of some construct:

So it seems that there should be some hook for extensions to hook into

wooorm commented 3 years ago

https://github.com/micromark/micromark-extension-gfm-task-list-item