function splitInput(str) {
  // now let it handle event without start with --- which is used in hexo
  if (str.slice(0, 3) !== "---"){
    str = "---\n" + str;
  }

  const matcher = /\n(\.{3}|-{3})/g;
  const metaEnd = matcher.exec(str);

  return metaEnd && [str.slice(0, metaEnd.index), str.slice(matcher.lastIndex)];
}
// Splits the given string into a meta section and a markdown section if a meta section is present, else returns null
Splits the given string into a meta section and a markdown section if a meta section is present, else returns null
Splits the given string into a meta section and a markdown section if a meta section is present else returns null
function splitInput(str) {
  if (str.slice(0, 3) !== "---"){
    str = "---\n" + str;
  }
  const matcher = /\n(\.{3}|-{3})/g;
  const metaEnd = matcher.exec(str);
  return metaEnd && [str.slice(0, metaEnd.index), str.slice(matcher.lastIndex)];
}
function splitInput ( str ) { if ( str . slice ( 0 , 3 ) !== "---" ) { str = "---\n" + str ; } const matcher = / \n(\.{3}|-{3}) / g ; const metaEnd = matcher . exec ( str ) ; return metaEnd && [ str . slice ( 0 , metaEnd . index ) , str . slice ( matcher . lastIndex ) ] ; }
Splits the given string into a meta section and a markdown section if a meta section is present, else returns null
Splits the given string into a meta section and a markdown section if a meta section is present else returns null
// now let it handle event without start with --- which is used in hexo