my test code:
### Solar System Exploration, 1950s – 1960s
- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [ ] Jupiter
- [ ] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley
results:
Solar System Exploration, 1950s – 1960s
- [ ] Mercury
- [x] Venus
- [x] Earth (Orbit/Moon)
- [x] Mars
- [ ] Jupiter
- [ ] Saturn
- [ ] Uranus
- [ ] Neptune
- [ ] Comet Haley
my config:
marked.setOptions({
gfm: true,
tables: true,
highlight: function (code, lang) {
return hljs.highlightAuto(code, [lang]).value;
}
});
I think task lists are not considered part of GFM, but as an additional feature of GitHub, just like auto-linking of commits/users/issues references.
I was looking for this today as well. Would love to see it added here!
I found this #107 , It works
var renderer = new marked.Renderer();
renderer.listitem = function(text) {
if (/^\s*\[[x ]\]\s*/.test(text)) {
text = text
.replace(/^\s*\[ \]\s*/, '<i class="empty checkbox icon"></i> ')
.replace(/^\s*\[x\]\s*/, '<i class="checked checkbox icon"></i> ');
return '<li style="list-style: none">' + text + '</li>';
} else {
return '<li>' + text + '</li>';
}
};
+1 to add this feature by default
Most helpful comment
+1 to add this feature by default