Output of GFM Checkboxes/Todos

josh.fishburn's Avatar

josh.fishburn

21 Oct, 2016 03:26 AM

Is there a way to get Marked to export checkboxes that render in a browser? Marked renders GFM checkboxes properly, but when using Copy as HTML or export to HTML, it simply exports list items with the literal characters ("[ ]"). I thought it would actually generate a checkbox "input" element. If this isn't in Marked's purview, any suggestions to get this working with custom CSS or a processor/preprocessor command?

  1. Support Staff 1 Posted by Brett on 21 Oct, 2016 06:57 PM

    Brett's Avatar

    I'm currently generating the tasks lists in the preview with JavaScript,
    meaning it doesn't affect the original markup. This was a reasonable
    solution as most people using the format at the time were just
    previewing documents that would be used on GitHub and stored as
    Markdown. The lists work in PDF export and print, but not HTML export.

    Given the increased adoption of the checklist format outside of GitHub,
    I'll consider adding handling into the original processing. In the
    meantime, a preprocessor _could_ do it, searching for the "- [ ]" format
    and inserting HTML for input checkboxes. I could help you write
    something for this if needed.

    -Brett

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