Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task lists? #329

Closed
buotex opened this issue Dec 6, 2013 · 3 comments
Closed

Task lists? #329

buotex opened this issue Dec 6, 2013 · 3 comments

Comments

@buotex
Copy link

buotex commented Dec 6, 2013

Hi,
as I'm using redcarpet to render a static blog with, I wanted to know if there's any possibility to use task lists (https://github.com/blog/1375-task-lists-in-gfm-issues-pulls-comments) when doing so.

@mattr-
Copy link
Collaborator

mattr- commented Dec 6, 2013

No. That functionality isn't implemented yet.

@mattr- mattr- closed this as completed Dec 6, 2013
@lifeiscontent
Copy link

@mattr- when will it be?

@robin850
Copy link
Collaborator

Actually I'm not sure this will ever be implemented in vanilla Redcarpet, this is pretty straightforward to implement:

class CustomRender < Redcarpet::Render::HTML
  def list_item(text, list_type)
    if text.start_with?("[x]", "[X]")
      text[0..2] = %(<input type="checkbox" checked="checked">)
    elsif text.start_with?("[ ]")
      text[0..2] = %(<input type="checkbox">)
    end

    %(<li>#{text}</li>)
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants