Skip to content

Commit 6da73e4

Browse files
CHENJIAMIANclaude
andcommitted
Fix: navigation links for TSL and Global sections
- Updated page.js to not add className prefix for TSL and Global pages - This fixes the issue where navigation sidebar links pointed to wrong anchors - Previously TSL.Break would look for id="TSL.Break", when it should be id="Break" - Both docs/scripts/page.js and utils/docs/template/static/scripts/page.js updated Fixes #32302 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 1d07e4f commit 6da73e4

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

docs/scripts/page.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ if ( typeof hljs !== 'undefined' ) {
5959
if ( ! isSamePageLink ) return;
6060

6161
const hash = target.hash.substring( 1 );
62-
const newHash = ( hash !== className ) ? `#${className}.${hash}` : `#${hash}`;
62+
// For TSL and Global pages, don't add className prefix since the anchors are direct
63+
const newHash = ( className === 'TSL' || className === 'Global' || hash === className ) ? `#${hash}` : `#${className}.${hash}`;
6364
const targetWindow = ( window.parent !== window ) ? window.parent : window;
6465

6566
targetWindow.history.pushState( null, '', newHash );

utils/docs/template/static/scripts/page.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ if ( typeof hljs !== 'undefined' ) {
5959
if ( ! isSamePageLink ) return;
6060

6161
const hash = target.hash.substring( 1 );
62-
const newHash = ( hash !== className ) ? `#${className}.${hash}` : `#${hash}`;
62+
// For TSL and Global pages, don't add className prefix since the anchors are direct
63+
const newHash = ( className === 'TSL' || className === 'Global' || hash === className ) ? `#${hash}` : `#${className}.${hash}`;
6364
const targetWindow = ( window.parent !== window ) ? window.parent : window;
6465

6566
targetWindow.history.pushState( null, '', newHash );

0 commit comments

Comments
 (0)