From 245beea37591fccc2ab892a850651b2a7d006ecf Mon Sep 17 00:00:00 2001 From: Dmitriy Razmakhov <4627811-cpkio@users.noreply.github.com> Date: Tue, 6 Feb 2024 21:02:47 +0300 Subject: [PATCH] ensure discrete headings are not included in page TOC --- preview-src/index.adoc | 3 +++ src/js/02-on-this-page.js | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/preview-src/index.adoc b/preview-src/index.adoc index bdae1cd2..7cb7d84a 100644 --- a/preview-src/index.adoc +++ b/preview-src/index.adoc @@ -285,6 +285,9 @@ Eu mea inani iriure. [discrete] == Voluptua singulis +[discrete] +=== Nominavi luptatum + Cum dicat putant ne. Est in reque homero principes, meis deleniti mediocrem ad has. Ex nam suas nemore dignissim, vel apeirian democritum et. diff --git a/src/js/02-on-this-page.js b/src/js/02-on-this-page.js index 035bea45..3271eaca 100644 --- a/src/js/02-on-this-page.js +++ b/src/js/02-on-this-page.js @@ -14,7 +14,7 @@ var headingSelector = [articleSelector] if (level) { for (var l = 1; l <= level; l++) headingSelector.push((l === 2 ? '.sectionbody>' : '') + '.sect' + l) - headingSelector.push('h' + (level + 1) + '[id]') + headingSelector.push('h' + (level + 1) + '[id]' + (level > 1 ? ':not(.discrete)' : '')) } else { headingSelector.push('h1[id].sect0') }