Merge pull request 'fix(glossaire): include standalone relation headings in reading follow' (#304) from fix/glossaire-reading-follow-relations-h2 into main
Reviewed-on: #304
This commit was merged in pull request #304.
This commit is contained in:
@@ -1500,6 +1500,7 @@ const WHOAMI_FORCE_LOCALHOST = (import.meta.env.PUBLIC_WHOAMI_FORCE_LOCALHOST ??
|
|||||||
.filter(Boolean);
|
.filter(Boolean);
|
||||||
|
|
||||||
const h2Plain = Array.from(reading.querySelectorAll("h2[id]"))
|
const h2Plain = Array.from(reading.querySelectorAll("h2[id]"))
|
||||||
|
.filter((h2) => !h2.closest("details.details-section"))
|
||||||
.map((h2) => ({
|
.map((h2) => ({
|
||||||
id: h2.id,
|
id: h2.id,
|
||||||
anchor: h2,
|
anchor: h2,
|
||||||
@@ -1508,7 +1509,7 @@ const WHOAMI_FORCE_LOCALHOST = (import.meta.env.PUBLIC_WHOAMI_FORCE_LOCALHOST ??
|
|||||||
h2,
|
h2,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
const H2 = (h2Anchors.length ? h2Anchors : h2Plain)
|
const H2 = [...h2Anchors, ...h2Plain]
|
||||||
.slice()
|
.slice()
|
||||||
.sort((a, b) => absTop(a.marker) - absTop(b.marker));
|
.sort((a, b) => absTop(a.marker) - absTop(b.marker));
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user