code: function renderImage(href, title, text) {
      var renderOpts;
  
      if (typeof href !== 'object') {
        renderOpts = this.options || defaultRenderOpts(); // this -> marked renderer
      }
      else {
        renderOpts = href;
        href = esc(renderOpts.href);
        title = esc(renderOpts.title);
        text = esc(renderOpts.text);
      }
  
      var out, iframe;
  
      href = rewriteLink(href, renderOpts);
  
      if (href && (m = href.match(/vimeo\/(\d+)/i))) {
        iframe = true;
        out = '<iframe src="//player.vimeo.com/video/' + m[1] + '"' +
                ' frameborder="0" webkitAllowFullScreen mozallowfullscreen allowFullScreen';
      }
      else {
        out = '<img src="' + href + '" alt="' + text + '"';
      }
  
      var a = (title && title.split(/\s+/)) || [];
      var b = [];
      var m;
      a.forEach(function(w) {
        if ((m = w.match(/^(\d+)x(\d+)$/))) return (out += ' width="' + m[1] + '" height="' + m[2] + '"');
        if ((m = w.match(/^(\w+)=(\w+)$/))) return (out += ' ' + m[1] + '="' + m[2] + '"');
        if (w) return b.push(w);
      });
      title = b.join(' ');
  
      if (title) {
        out += ' title="' + title + '"';
      }
  
      out += iframe ? '></iframe>' :
             renderer.options.xhtml ? '/>' :
             '>';
  
      return out;
    }
docs: renderImage (same as marked-image module but can call rewriteLink) function signature matches marked.js image renderer (href, title, text) supports alternative object param {href, title, text, renderOpts...} NOTE: params passed as strings are assumed pre-html-escaped, params in {} are not.