src/utils/front-matter/parse.js/parse
function parse(text) {
  const match = text.match(frontMatterRegex);
  if (!match) {
    return { content: text };
  }

  const { startDelimiter, language, value = "", endDelimiter } = match.groups;

  let lang = language.trim() || "yaml";
  if (startDelimiter === "+++") {
    lang = "toml";
  }

  // Only allow yaml to parse with a different end delimiter
  if (lang !== "yaml" && startDelimiter !== endDelimiter) {
    return { content: text };
  }

  const [raw] = match;
  const frontMatter = {
    type: "front-matter",
    lang,
    value,
    startDelimiter,
    endDelimiter,
    raw: raw.replace(/\n$/, ""),
  };

  return {
    frontMatter,
    content: raw.replace(/[^\n]/g, " ") + text.slice(raw.length),
  };
}