lib/stmd.js
function(inline) {
  var attrs;
  switch (inline.t) {
    case 'Str':
      return this.escape(inline.c);
    case 'Softbreak':
      return this.softbreak;
    case 'Hardbreak':
      return inTags('br',[],"",true) + '\n';
    case 'Emph':
      return inTags('em', [], this.renderInlines(inline.c));
    case 'Strong':
      return inTags('strong', [], this.renderInlines(inline.c));
    case 'Html':
      return inline.c;
    case 'Entity':
      return inline.c;
    case 'Link':
      attrs = [['href', this.escape(inline.destination, true)]];
      if (inline.title) {
        attrs.push(['title', this.escape(inline.title, true)]);
      }
      return inTags('a', attrs, this.renderInlines(inline.label));
    case 'Image':
      attrs = [['src', this.escape(inline.destination, true)],
                   ['alt', this.escape(this.renderInlines(inline.label))]];
      if (inline.title) {
        attrs.push(['title', this.escape(inline.title, true)]);
      }
      return inTags('img', attrs, "", true);
    case 'Code':
      return inTags('code', [], this.escape(inline.c));
    default:
      console.log("Uknown inline type " + inline.t);
      return "";
  }
}
function(inline) {
  var attrs;
  switch (inline.t) {
    case 'Str':
      return this.escape(inline.c);
    case 'Softbreak':
      return this.softbreak;
    case 'Hardbreak':
      return inTags('br',[],"",true) + '\n';
    case 'Emph':
      return inTags('em', [], this.renderInlines(inline.c));
    case 'Strong':
      return inTags('strong', [], this.renderInlines(inline.c));
    case 'Html':
      return inline.c;
    case 'Entity':
      return inline.c;
    case 'Link':
      attrs = [['href', this.escape(inline.destination, true)]];
      if (inline.title) {
        attrs.push(['title', this.escape(inline.title, true)]);
      }
      return inTags('a', attrs, this.renderInlines(inline.label));
    case 'Image':
      attrs = [['src', this.escape(inline.destination, true)],
                   ['alt', this.escape(this.renderInlines(inline.label))]];
      if (inline.title) {
        attrs.push(['title', this.escape(inline.title, true)]);
      }
      return inTags('img', attrs, "", true);
    case 'Code':
      return inTags('code', [], this.escape(inline.c));
    default:
      console.log("Uknown inline type " + inline.t);
      return "";
  }
}
function ( inline ) { var attrs ; switch ( inline . t ) { case 'Str' : return this . escape ( inline . c ) ; case 'Softbreak' : return this . softbreak ; case 'Hardbreak' : return inTags ( 'br' , [ ] , "" , true ) + '\n' ; case 'Emph' : return inTags ( 'em' , [ ] , this . renderInlines ( inline . c ) ) ; case 'Strong' : return inTags ( 'strong' , [ ] , this . renderInlines ( inline . c ) ) ; case 'Html' : return inline . c ; case 'Entity' : return inline . c ; case 'Link' : attrs = [ [ 'href' , this . escape ( inline . destination , true ) ] ] ; if ( inline . title ) { attrs . push ( [ 'title' , this . escape ( inline . title , true ) ] ) ; } return inTags ( 'a' , attrs , this . renderInlines ( inline . label ) ) ; case 'Image' : attrs = [ [ 'src' , this . escape ( inline . destination , true ) ] , [ 'alt' , this . escape ( this . renderInlines ( inline . label ) ) ] ] ; if ( inline . title ) { attrs . push ( [ 'title' , this . escape ( inline . title , true ) ] ) ; } return inTags ( 'img' , attrs , "" , true ) ; case 'Code' : return inTags ( 'code' , [ ] , this . escape ( inline . c ) ) ; default : console . log ( "Uknown inline type " + inline . t ) ; return "" ; } }
Render an inline element as HTML.
Render an inline element as HTML .