Created
May 29, 2013 20:50
-
-
Save Heavyblade/5673742 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'redcarpet' | |
| class CustomRender < Redcarpet::Render::HTML | |
| def list_item(text, list_type) | |
| case text | |
| when /\[\s?x\s?\]/ | |
| "<li><input type='checkbox' value='true' checked>#{text.gsub(/\[\s?x\s?\]/, "").strip}</li>\n" | |
| when /\[\s?\]/ | |
| "<li><input type='checkbox' value='false'>#{text.gsub(/\[\s?\]/, "").strip}</li>\n" | |
| else | |
| "<li>#{text}</li>\n" | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment