lib/stmd.js
function(inlines) {
  var startpos = this.pos;
  var ticks = this.match(/^`+/);
  if (!ticks) {
    return 0;
  }
  var afterOpenTicks = this.pos;
  var foundCode = false;
  var match;
  while (!foundCode && (match = this.match(/`+/m))) {
    if (match == ticks) {
      inlines.push({ t: 'Code', c: this.subject.slice(afterOpenTicks,
                                   this.pos - ticks.length)
             .replace(/[ \n]+/g,' ')
             .trim() });
      return (this.pos - startpos);
    }
  }
  // If we got here, we didn't match a closing backtick sequence.
  inlines.push({ t: 'Str', c: ticks });
  this.pos = afterOpenTicks;
  return (this.pos - startpos);
}
function(inlines) {
  var startpos = this.pos;
  var ticks = this.match(/^`+/);
  if (!ticks) {
    return 0;
  }
  var afterOpenTicks = this.pos;
  var foundCode = false;
  var match;
  while (!foundCode && (match = this.match(/`+/m))) {
    if (match == ticks) {
      inlines.push({ t: 'Code', c: this.subject.slice(afterOpenTicks,
                                   this.pos - ticks.length)
             .replace(/[ \n]+/g,' ')
             .trim() });
      return (this.pos - startpos);
    }
  }
  // If we got here, we didn't match a closing backtick sequence.
  inlines.push({ t: 'Str', c: ticks });
  this.pos = afterOpenTicks;
  return (this.pos - startpos);
}
function ( inlines ) { var startpos = this . pos ; var ticks = this . match ( / ^`+ / ) ; if ( ! ticks ) { return 0 ; } var afterOpenTicks = this . pos ; var foundCode = false ; var match ; while ( ! foundCode && ( match = this . match ( / `+ / m ) ) ) { if ( match == ticks ) { inlines . push ( { t : 'Code' , c : this . subject . slice ( afterOpenTicks , this . pos - ticks . length ) . replace ( / [ \n]+ / g , ' ' ) . trim ( ) } ) ; return ( this . pos - startpos ) ; } } // If we got here, we didn't match a closing backtick sequence. inlines . push ( { t : 'Str' , c : ticks } ) ; this . pos = afterOpenTicks ; return ( this . pos - startpos ) ; }
Attempt to parse backticks, adding either a backtick code span or a literal sequence of backticks to the 'inlines' list.
Attempt to parse backticks adding either a backtick code span or a literal sequence of backticks to the inlines list .