From 88007b10fe2951d2f9aa62e2472067b51e1783b1 Mon Sep 17 00:00:00 2001 From: Test User Date: Sun, 30 Nov 2025 10:11:07 +0800 Subject: [PATCH] fix: Remove {:.no_toc} paragraphs from HTML output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #100 The {:.no_toc} kramdown IAL marker was being used to exclude headings from the TOC, but the marker paragraph itself remained in the rendered HTML output. Root cause: processTOC() was parsing HTML into a DOM for marker replacement, but generateTOC() was parsing HTML again into a separate DOM tree. When hasNoTocSibling() removed the {:.no_toc} paragraph during TOC generation, the removal only affected the second DOM tree, not the one rendered to output. Fix: Renamed generateTOC() to generateTOCFromDoc() which accepts an already-parsed *html.Node instead of []byte. This allows processTOC() to pass its DOM tree directly, so modifications made by extractHeadings() (via hasNoTocSibling()) are preserved in the final output. Also fixed UseJekyllHTML default in getTOCOptions() from false to true to match Jekyll's