class Middleman::Renderers::MiddlemanRedcarpetHTML

Custom Redcarpet renderer that uses our helpers for images and links

Public Class Methods

new(options={}) click to toggle source
Calls superclass method
# File lib/middleman-core/renderers/redcarpet.rb, line 68
def initialize(options={})
  @local_options = options.dup

  super
end

Public Instance Methods

image(link, title, alt_text) click to toggle source
# File lib/middleman-core/renderers/redcarpet.rb, line 74
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
    "![#{alt_text}](#{link_string})"
  end
end