class Middleman::Renderers::MiddlemanRedcarpetHTML
Custom Redcarpet renderer that uses our helpers for images and links
Public Class Methods
Source
# File lib/middleman-core/renderers/redcarpet.rb, line 58 def initialize(options={}) @local_options = options.dup super end
Calls superclass method
Public Instance Methods
Source
# File lib/middleman-core/renderers/redcarpet.rb, line 64 def image(link, title, alt_text) if !@local_options[:no_images] scope.image_tag(link, title: title, alt: alt_text) else link_string = link.dup link_string << %("#{title}") if title && !title.empty? && title != alt_text "" end end
Source
# File lib/middleman-core/renderers/redcarpet.rb, line 74 def link(link, title, content) if !@local_options[:no_links] attributes = { title: title } attributes.merge!(@local_options[:link_attributes]) if @local_options[:link_attributes] scope.link_to(content, link, attributes) else link_string = link.dup link_string << %("#{title}") if title && !title.empty? && title != alt_text "[#{content}](#{link_string})" end end