0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-28 11:22:39 +00:00

Corrections per PR

Remove off by one error realted to change in page number detection.
Dewrap quotes from exclude screen.
This commit is contained in:
dbolack
2024-03-23 18:57:53 -05:00
parent 1e4f804542
commit 1705e66be2

View File

@@ -5,7 +5,7 @@ const getTOC = ()=>{
const add1 = (title, page)=>{
res.push({
title : title,
page : page + 1,
page : page,
children : []
});
};
@@ -13,7 +13,7 @@ const getTOC = ()=>{
if(!_.last(res)) add1(null, page);
_.last(res).children.push({
title : title,
page : page + 1,
page : page,
children : []
});
};
@@ -22,7 +22,7 @@ const getTOC = ()=>{
if(!_.last(_.last(res).children)) add2(null, page);
_.last(_.last(res).children).children.push({
title : title,
page : page + 1,
page : page,
children : []
});
};
@@ -35,7 +35,7 @@ const getTOC = ()=>{
_.each(headings, (heading)=>{
const onPage = parseInt(heading.closest('.page,.phb').id?.replace(/^p/, ''));
const ToCExclude = getComputedStyle(heading).getPropertyValue('--TOC');
if(ToCExclude != '"exclude"') {
if(ToCExclude != 'exclude') {
if(!isNaN(onPage)) {
const headingText = heading.innerText;
if(heading.tagName == 'H1') {