Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

monograph: remove callout headings from toc (#6875) (#6993)

01zulfi2462eb16319c
diff --git a/apps/monograph/app/components/monographpost/index.tsx b/apps/monograph/app/components/monographpost/index.tsx
index ac820ec0f..21fc0c409 100644
--- a/apps/monograph/app/components/monographpost/index.tsx
+++ b/apps/monograph/app/components/monographpost/index.tsx
@@ -73,6 +73,11 @@ function generateTableOfContents() {
let currentHeading = 0;
for (const heading of headings) {
+ const isCalloutHeading = heading.closest(".callout");
+ if (isCalloutHeading) {
+ continue;
+ }
+
const text = heading.textContent || "<empty>";
const nodeName = heading.nodeName;
const headingLevel = levelsMap[nodeName];