permalink.js
function(permalink) {
    permalink = permalink || '';
    if (permalink.slice(0, 1) !== PATH_SEP) {
      permalink = PATH_SEP + permalink;
    }
    permalink = permalink.replace(INDEX_RE, PATH_SEP);
    return permalink;
  }
function(permalink) {
    permalink = permalink || '';
    if (permalink.slice(0, 1) !== PATH_SEP) {
      permalink = PATH_SEP + permalink;
    }
    permalink = permalink.replace(INDEX_RE, PATH_SEP);
    return permalink;
  }
function ( permalink ) { permalink = permalink || '' ; if ( permalink . slice ( 0 , 1 ) !== PATH_SEP ) { permalink = PATH_SEP + permalink ; } permalink = permalink . replace ( INDEX_RE , PATH_SEP ) ; return permalink ; }
standardize permalink output
standardize permalink output