module Leg::Markdown
Constants
- HTML_RENDERER
- MARKDOWN_RENDERER
Public Class Methods
render(source)
click to toggle source
# File lib/leg/markdown.rb, line 10 def self.render(source) html = MARKDOWN_RENDERER.render(source) html = Redcarpet::Render::SmartyPants.render(html) html.gsub!(/<\/code>‘/) { "</code>’" } html.gsub!(/^\s*<h([23456]) id="([^"]+)">(.+)<\/h\d>$/) { "<h#{$1} id=\"#{$2}\"><a href=\"##{$2}\">#{$3}</a></h#{$1}>" } html end