From 2cea38d520506ddd9cc97cf9f7846ae4f10ae303 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Bardon?= Date: Mon, 2 Feb 2026 19:50:29 +0800 Subject: [PATCH] feat!: Fix heading ID discrepancy between sidebar and article MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes incorrect IDs in the sidebar when a heading contains an underscore (`_`). For example, “## branding.api_app_name” gets rendered as ```html

branding.api_app_name

``` in the page, but was rendered as ```html branding.api_app_name ``` in the sidebar. This meant the sidebar was broken, because it pointed to an inexistent ID. --- res/plugins/gulp/pug-templates.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/res/plugins/gulp/pug-templates.js b/res/plugins/gulp/pug-templates.js index 3d21c9a..7198b2b 100644 --- a/res/plugins/gulp/pug-templates.js +++ b/res/plugins/gulp/pug-templates.js @@ -719,7 +719,7 @@ module.exports = { // Start a new current entry? if (_item !== null) { _current_entry = { - id : _item.slug, + id : slug(_item.content), title : _item.content, subtrees : [] };