docs: function matter(str, opts) {
  
    str = formatString(str);
    opts = formatOptions(opts);
    var result = {src: str, data: null, body: str};
    if (!str) {
      return result;
    }
  
    var strict = !opts.loose;
    var header = opts.delims[0];
    var footer = opts.delims[1];
    var dataStart, dataEnd;
    // Front matter must start from the first byte.
    if (str.substr(0, header.length) !== header ||
        // Whether the delimiter is followed by a strange character.
        (!opts.loose && header.length < str.length &&
            str[header.length] !== '\n' &&
            str[header.length] === header[header.length-1]) ||
        // Metadata and delimiters should be separated with linefeeds.
        (dataStart = str.indexOf('\n', header.length)) < 0 ||
        (dataEnd = str.indexOf('\n' + footer, dataStart)) < 0) {
      return result;
    }
    var bodyStart = dataEnd + 1 + footer.length;
    // Whether the delimiter is followed by strange characters.
    if (strict && bodyStart < str.length) {
      if (str[bodyStart] !== '\n' && str[bodyStart] === footer[footer.length-1]) {
        return result;
      }
      while (bodyStart < str.length && str[bodyStart] !== '\n') {
        if (/^[^\s]$/.test(str[bodyStart])) {
          return result;
        }
        bodyStart++;
      }
    }  // else: Tolerate the case that a linefeed is missing: <end-delimiter><body>
    if (str[bodyStart] === '\r') { bodyStart++; }
    if (str[bodyStart] === '\n') { bodyStart++; }
    var data;
    if (dataStart < dataEnd &&
        (data = str.substr(dataStart, dataEnd - dataStart).trim())) {
      var lang = str.substr(header.length, dataStart - header.length)
                    .trim().toLowerCase() || opts.lang;
      var parse;
      if (typeof opts.parsers === 'function') {
        parse = opts.parsers;
      } else if (opts.parsers != null && opts.parsers[lang]) {
        parse = opts.parsers[lang];
      } else {
        parse = matter.parsers[lang];
      }
      if (typeof parse === 'function') {
        result.data = parse(data, {loose: opts.loose});
      } else {
        throw new Error(message('No parser found for the language: ' + lang));
      }
    }
    result.body = result.body.substr(bodyStart);
  
    return result;
  }