app/helpers/markdown_helper.rb
#
# Create an image tag with a protocol-relative URL
#
# @param url [String] the image URL
# @param title [String, nil] the image title
# @param alt [String, nil] the image's alternative text
#
# @return [String] an image tag
#
Create an image tag with a protocol-relative URL
Create an image tag with a protocol - relative URL
def image(url, title, alt)
      options = {
        src: relative_url = url.sub(/\Ahttps?:/, ''),
        alt: String(alt),
        title: title
      }
      tag(:img, options, true)
    end
def image ( url , title , alt ) options = { src : relative_url = url . sub ( / \A https?: / , '' ) , alt : String ( alt ) , title : title } tag ( :img , options , true ) end
Create an image tag with a protocol-relative URL
Create an image tag with a protocol - relative URL
an image tag
an image tag
String
url
the image URL
the image URL
title
the image title
the image title
alt
the image's alternative text
the image ' s alternative text