icyleaf / markd

Yet another markdown parser, Compliant to CommonMark specification, written in Crystal.
MIT License
109 stars 30 forks source link

gfm task list / checkbox support #63

Closed nobodywasishere closed 3 months ago

nobodywasishere commented 3 months ago

This pull request adds support for GFM task lists / checkboxes, as well as fixing some issues with spacing in gfm-spec.txt, bringing the current number of pending tests down to 30.

require "./src/markd"

markdown = <<-MD
# Hello Markd

> Yet another markdown parser built for speed, written in Crystal, Compliant to CommonMark specification.
> - [ ] check box

- [ ] one
  - [x] two
    - [ ] three
MD

options = Markd::Options.new(gfm: true)
puts Markd.to_html(markdown, options)
<h1>Hello Markd</h1>
<blockquote>
<p>Yet another markdown parser built for speed, written in Crystal, Compliant to CommonMark specification.</p>
<ul>
<li><input disabled="" type="checkbox"> check box</li>
</ul>
</blockquote>
<ul>
<li><input disabled="" type="checkbox"> one
<ul>
<li><input checked="" disabled="" type="checkbox"> two
<ul>
<li><input disabled="" type="checkbox"> three</li>
</ul>
</li>
</ul>
</li>
</ul>