0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-15 23:32:41 +00:00

Merge pull request #2945 from 5e-Cleric/TOC-generate-fix

exclude covers from TOC generation
This commit is contained in:
Trevor Buckner
2023-08-04 19:16:58 -04:00
committed by GitHub

View File

@@ -29,6 +29,7 @@ const getTOC = (pages)=>{
const res = [];
_.each(pages, (page, pageNum)=>{
if(!page.includes("{{frontCover}}") && !page.includes("{{insideCover}}") && !page.includes("{{partCover}}") && !page.includes("{{backCover}}")) {
const lines = page.split('\n');
_.each(lines, (line)=>{
if(_.startsWith(line, '# ')){
@@ -44,6 +45,7 @@ const getTOC = (pages)=>{
add3(title, pageNum);
}
});
}
});
return res;
};