Skip to content

Tasklists with nameless checkboxes move checkbox to next paragraph #882

@BenjaminRi

Description

@BenjaminRi

Suppose you have the following markdown code, which contains a nameless checkbox:

* [ ] 
---
bar

So, we run:

printf '* [ ] \n---\nbar' | cargo run -- --enable-tasklists

This results in:

<ul>
<li></li>
</ul>
<hr />
<p><input disabled="" type="checkbox"/>
bar</p>

Which looks like a stray checkbox after the horizontal rule:

markdown_tasklist_stray_checkbox

The checkbox was erroneously added to the next paragraph element.

Additionally, if there is no paragraph following, the checkboxes disappear completely:

printf '* [ ] \n* [ ] \n* [ ] \n' | cargo run -- --enable-tasklists
<ul>
<li></li>
<li></li>
<li></li>
</ul>

It seems to me like this behavior was introduced after #557 was fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions