mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-14 04:12:43 +00:00
Add fixes to account for no page numbers
Clear out manual toggles.
This commit is contained in:
@@ -33,10 +33,10 @@ const getTOC = ()=>{
|
||||
const headings = iframeDocument.querySelectorAll('h1, h2, h3');
|
||||
|
||||
_.each(headings, (heading)=>{
|
||||
const onPage = parseInt(heading.closest('.page,.phb').id.replace(/^p/, ''));
|
||||
const onPage = parseInt(heading.closest('.page,.phb').id?.replace(/^p/, ''));
|
||||
const ToCExclude = getComputedStyle(heading).getPropertyValue('--TOC');
|
||||
if(ToCExclude != '"exclude"') {
|
||||
if(onPage != -1) {
|
||||
if(!isNaN(onPage)) {
|
||||
const headingText = heading.innerText;
|
||||
if(heading.tagName == 'H1') {
|
||||
add1(headingText, onPage);
|
||||
|
||||
Reference in New Issue
Block a user