class Docks::Markdown::Renderer
Public Instance Methods
block_code(code, language)
click to toggle source
# File lib/docks/markdown.rb, line 6 def block_code(code, language) return nil unless language "<fenced_code_block #{"data-has-demo='true'" unless (language =~ /demo/).nil?} data-language='#{language.sub(/_?demo/, "")}'>#{code}</fenced_code_block>" end
link(href, title, content)
click to toggle source
# File lib/docks/markdown.rb, line 11 def link(href, title, content) href = "@link #{content.gsub(/<[^>]*>/, "").strip}" if href.strip == "@link" content = "<span>#{content}</span>" unless content.strip.start_with?("<") "<a href=\"#{href}\"#{" title=\"#{title}\"" unless title.nil?}>#{content}</a>" end