// used below to remove extra newlines in TOC lists const endLine: string = '\r?\n' const blankLine: string = '\\s*?[\r\n]*' const startNextLine: string = '[^\\S\r\n]*?[-\\*] foo // // - bar if (template.includes('')) { template = template.replace(blankLineInList, '$1$2') } return template } function cleanUpExtraEmptyLines(template: string): string { // this removes any extra newlines left by (now resolved) liquid // statements so that extra space doesn't mess with list numbering template = template.replace(/(\r?\n){3}/g, '\n\n') return template }