From 1004c2250f102e4d5542f018a4748fa9638cdd3d Mon Sep 17 00:00:00 2001 From: hamki Date: Tue, 3 Feb 2026 06:24:21 +0800 Subject: [PATCH] Refactor TOC rendering and improve HTML structure - Updated the rendering of table of contents (TOC) items to ensure proper closing of list items in HTML. - Removed redundant header extraction logic from orgmode, enabling TOC extraction during post-processing. - Simplified sidebar visibility state management by utilizing user settings instead of localStorage. This enhances the overall structure and maintainability of the markup rendering process. --- modules/markup/html.go | 10 +--- modules/markup/html_toc_test.go | 4 +- modules/markup/orgmode/orgmode.go | 38 ++------------- modules/markup/orgmode/orgmode_test.go | 66 -------------------------- web_src/js/features/file-view.ts | 23 ++++----- 5 files changed, 15 insertions(+), 126 deletions(-) diff --git a/modules/markup/html.go b/modules/markup/html.go index c2339838e5..acd2f18471 100644 --- a/modules/markup/html.go +++ b/modules/markup/html.go @@ -254,7 +254,7 @@ func RenderTocHeadingItems(ctx *RenderContext, nodeDetailsAttrs map[string]strin currentLevel := baseLevel indent := []byte{' ', ' '} _, _ = htmlutil.HTMLPrint(out, "