GitHub Style Task lists.

Joshua's Avatar

Joshua

19 Jan, 2014 12:20 PM

"- [ ] " and "- [x] " Style lists are supposed to show up as task lists in github format, however it seems that Marked only renders checkboxes if the style is checked and nothing (not even a list item) if the checkbox is empty.

https://help.github.com/articles/github-flavored-markdown#task-lists

  1. Support Staff 1 Posted by Brett on 19 Jan, 2014 02:34 PM

    Brett's Avatar

    Works for me. Do you have a space between the empty brackets?

  2. 2 Posted by Joshua on 22 Jan, 2014 01:15 AM

    Joshua's Avatar

    Hmm, it said post was successful but checking back I see it wasn't posted. That's not good. Here it is again, I simple included a screen shot, and yes there is a space.

    I notice there are other formatting issues as well.

  3. Support Staff 3 Posted by Brett on 22 Jan, 2014 01:26 AM

    Brett's Avatar

    I need that actual file. It appears your using two spaces to indent,
    which doesn't work. You need 4. I'm wondering if there are any other
    formatting issues, please attach that sample file.

    -Brett

  4. 4 Posted by Joshua on 22 Jan, 2014 02:04 AM

    Joshua's Avatar

    Well it's a production file, but I went ahead and redacted stuff I probably shouldn't share. When I tried to delete everything out of view the problem partially went away, which was surprising, so I included the entire file redacted. It is not fully formatted correctly, and I left it in it's current state other then the redactions.
    I also made a gist of it so you could also see it in context. I understood that the 4 space tab rule was with regard to code blocks. In other cases it's just a difference in indention level, and that seems to be confirmed in the gist render.

    https://gist.github.com/JoshuaKolden/8552185

    Thanks

  5. 5 Posted by Joshua on 22 Jan, 2014 02:19 AM

    Joshua's Avatar

    I keep having trouble posting here. I'm not sure if I need to wait longer or if things are not going to show up at all like last time, so sorry if this turns out to be a duplicate.

    Well it's a production file, but I went ahead and redacted stuff I probably shouldn't share. When I tried to delete everything out of view the problem partially went away, which was surprising, so I included the entire file redacted. It is not fully formatted correctly, and I left it in it's current state other then the redactions.
    I also made a gist of it so you could also see it in context. I understood that the 4 space tab rule was with regard to code blocks. In other cases it's just a difference in indention level, and that seems to be confirmed in the gist render.

    https://gist.github.com/JoshuaKolden/8552185

    Thanks

  6. 6 Posted by Joshua Kolden on 22 Jan, 2014 10:35 PM

    Joshua Kolden's Avatar

    Ok you’re support board is very buggy too, I’ve tried 3 times to post a response there over the last 24 hours. Each time it said it was successful, but to wait a few minutes for moderation, and each time nothing ever showed up. Moderation is superfluous. You already have a captcha (equivalent) USE IT. Let whoever provides an email and solves the captcha post immediately without moderation. If someone still posts spam then just delete it manually. That’s far better then blocking legitimate inquires / responses. (I don’t know why I care. Normally you would have lost me as a customer by now.)

    Here is my previous message again:

    Well it's a production file, but I went ahead and redacted the stuff I probably shouldn't share. When I tried to delete everything that is out of view the problem partially went away, which was surprising, so I included the entire file redacted. It is not fully formatted correctly, and I left it in it's current state other then the redactions.
    I also made a gist of it so you could see it in context. I understood that the 4 space tab rule was with regard to code blocks. In other cases it's just a difference in indention level that is relevant, and that seems to be confirmed in the gist render.

     https://gist.github.com/JoshuaKolden/8552185

    Thanks,
    j

  7. 7 Posted by Joshua on 23 Jan, 2014 01:13 AM

    Joshua's Avatar

    I've posted a reply 3 times here, and once by email. They never show up.

  8. Support Staff 8 Posted by Brett on 23 Jan, 2014 01:26 AM

    Brett's Avatar

    Could you try posing it as a gist and just adding the link? Might be some kind of blocker on the filetype...

  9. Support Staff 9 Posted by Brett on 23 Jan, 2014 01:28 AM

    Brett's Avatar

    I found them, they got spammed. Sorry about that.

  10. Support Staff 10 Posted by Brett on 23 Jan, 2014 01:46 AM

    Brett's Avatar

    Something in the latter half of the gist you posted is causing the [ ] to render as

    <ul>
    <li><a href="#"> </a> Testing</li>
    <li>[x] More testing</li>
    </ul>
    

    Which breaks the parser looking for the checkbox pattern, obviously. I haven't been able to narrow down exactly what's doing it, but there's some markup in there that's confusing to a Markdown processor. I'm not sure what the ------------ syntax you're using around code blocks is from, but even Github isn't liking that.

    As far as the two-space lists go, Marked uses MultiMarkdown by default, GitHub uses some form of Discount. Thus, if you go into Behavior preferences and switch to Discount, your lists will render fine.

    As far as the support board goes, I use Tender. They occasionally spam things that shouldn't be spammed, but there have been 1039 legitimately-spammed posts this week, so it's not something I could afford to moderate by hand. I apologize for your difficulty. I haven't seen it happen to anyone for quite a while now.

  11. Support Staff 11 Posted by Brett on 23 Jan, 2014 01:47 AM

    Brett's Avatar

    By the way, switching to Discount also fixes the checkboxes.

  12. 12 Posted by _patrickwelker on 26 Oct, 2014 07:01 PM

    _patrickwelker's Avatar

    I already saw your answer [here[(http://support.markedapp.com/discussions/problems/44381-bug-links-a...) explaining that this is a MultiMarkdown problem. So, I'll contact Fletcher about this, maybe he's in for fixing this.

    Still, to add my example to the list – just for further reference:

    marked github tasks

    Here's the example file: http://oho.xyz/test.md

    If I change make changes, c.f. mark one list item as done (via an X) Marked renders it correctly (but the source code won't change properly).

    If I change the processor from MMD to GFM it works, also the source code is correct.

  13. Support Staff 13 Posted by Brett on 26 Oct, 2014 08:39 PM

    Brett's Avatar

    Yeah, it's a weird bug. I forget if I followed up with Fletcher, but it still exists in the latest MMD version.

    With your sample text (and one task marked complete) the multimarkdown command line utility produces:

    <ul>
    <li>[ ] <a href="http://blog.jeffreykishner.com/2014/10/07/thankYouDave.html">http://blog.jeffreykishner.com/2014/10/07/thankYouDave.html</a> @added(2014&#8211;10&#8211;13) @high</li>
    <li>[X][Prep Work for iOS 8](http://www.macdrifter.com/2014/09/prep-work-for-ios&#8211;8.html) @added(2014&#8211;09&#8211;18)</li>
    <li>[ ][Chihuahua Robot Massage](http://www.crackajack.de/2014/08/30/chihuahua-robot-massage/) @added(2014&#8211;09&#8211;03)</li>
    <li>[ ][Land of Confusion](http://www.crackajack.de/2014/09/01/land-of-confusion/) @added(2014&#8211;09&#8211;03)</li>
    </ul>
    

    So it's compressing the spaces and then getting confused by the resulting [][]() format.

    You do have the option of escaping:

    - \[ ]
    

    so the scanner doesn't think it's starting a link on the first square bracketr... the escaped format still renders checkboxes properly on GitHub.

    If ultimately needed, I can just have Marked search for the /^\s*-\s+\[.\]/ pattern and escape it prior to processing.

    -Brett

  14. 14 Posted by _patrickwelker on 17 Dec, 2014 10:57 AM

    _patrickwelker's Avatar

    Mh. Although the last suggestions sounds like the solution, I think I can live with the status quo.

    Ultimately I don't want to sacrifice the speed of Marked just because I use GitHub style tasks in my regular MultiMarkdown. The needs of the many outweigh the needs of one person. I guess there could also arise more MMD problems when the regex is applied. MMD is so versatile when it comes to academic citations as well, c.f. a reference link like [see\]\[12][#Engelhardt:2003aa].

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac