Sha256: a47739c978b4a369a58b24450a447a1aecaa21a0e9298117e8526321b87449b2
Contents?: true
Size: 710 Bytes
Versions: 12
Compression:
Stored size: 710 Bytes
Contents
module Leandocument class Markdown < Render def to_html RDiscount.new(exec_trans).to_html end # Convert to something from content. # Currently, Change indent level. # TODO support plugin and expand format. # ==== Return # Text content. def exec_trans content = indented_content content = content.gsub(/^!\[(.*)\]\((.*)\)/, '![\\1]('+self.path+'\\2)') # For image end def indented_content content = analyse_content self.indent.times do |i| content = content.to_s.gsub(/^#/, "##") end unless self.indent == 1 content = "#{"#"*self.indent}#{title}\n#{content}" end content end end end
Version data entries
12 entries across 12 versions & 1 rubygems