Sha256: 29f01739c35a9ae63c66117705b65b346423f37928f31a9777ea016d34a84114
Contents?: true
Size: 535 Bytes
Versions: 3
Compression:
Stored size: 535 Bytes
Contents
# coding: utf-8 require "redcarpet" module Methan class MdRenderer < ::Redcarpet::Render::HTML def list_item(text, list_type) tag = "<li" r = /^\[(\s|x)\]\s/ m = r.match(text) if m input_tag = "<input type=\"checkbox\"" input_tag << " checked=\"true\"" if m[1] and m[1] == 'x' input_tag << ">" text = text.gsub(r, '') text = "#{input_tag} #{text}" tag << " class=\"task-item\"" end tag << ">#{text}</li>" return tag end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
methan-0.1.3 | lib/methan/md_renderer.rb |
methan-0.1.2 | lib/methan/md_renderer.rb |
methan-0.1.1 | lib/methan/md_renderer.rb |