code: function(c) {
    var numdelims = 0;
    var first_close_delims = 0;
    var char_before, char_after;
    var startpos = this.pos;
  
    char_before = this.pos === 0 ? '\n' :
      this.subject.charAt(this.pos - 1);
  
    while (this.peek() === c) {
      numdelims++;
      this.pos++;
    }
  
    char_after = this.peek() || '\n';
  
    var can_open = numdelims > 0 && numdelims <= 3 && !(/\s/.test(char_after));
    var can_close = numdelims > 0 && numdelims <= 3 && !(/\s/.test(char_before));
    if (c === '_') {
      can_open = can_open && !((/[a-z0-9]/i).test(char_before));
      can_close = can_close && !((/[a-z0-9]/i).test(char_after));
    }
    this.pos = startpos;
    return { numdelims: numdelims,
             can_open: can_open,
             can_close: can_close };
  }
docs: Scan a sequence of characters == c, and return information about the number of delimiters and whether they are positioned such that they can open and/or close emphasis or strong emphasis.  A utility function for strong/emph parsing.