github / cmark-gfm

GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C
Other
889 stars 173 forks source link

Tasklist doesn't display the same as CMARK_NODE_ITEM #143

Open NightFlyer opened 5 years ago

NightFlyer commented 5 years ago

If you have something like:

- [ ] task 1
- [x] completed task
- [X] another completed task
- not a task

Then I think that you should get the same result when calling cmark_render_commonmark whether or not the tasklist extension is enabled. Now, however, if the tasklist extension isn't enabled, you get items that match up appropriately, but if the tasklist extension is enabled, you get items that don't line up:

- [ ] task 1"
- [x] completed task
- [x] another completed task
  - not a task

The code in S_render_node for CMARK_NODE_ITEM puts in a different amount of spaces in the beginning of the line than the code in the tasklist extension, so the hypens don't line up.

kivikakk commented 5 years ago

Thanks! I'll fix this up. I really appreciate the bug reports and PRs. :heart:

kivikakk commented 5 years ago

This turns out to be much more complicated than I anticipated, so unfortunately it has to go on the backburner until I get a better block of free time.