From 0586e5ab478f7cfb1763d019eb014f2578106240 Mon Sep 17 00:00:00 2001 From: Ica <82805019+burak-efe@users.noreply.github.com> Date: Mon, 2 Dec 2024 22:44:00 +0300 Subject: [Docs] Fix dead links when subsection title have underscore (#5662) * [Docs] Fix dead links when subsection title have underscore a minor change on build toc script: add underscore to link instead of replacing with "-" then I re-run the script also I tested on local server * Update toc.html --------- Co-authored-by: Ellie Hermaszewska Co-authored-by: Yong He --- docs/scripts/Program.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'docs/scripts') diff --git a/docs/scripts/Program.cs b/docs/scripts/Program.cs index b256af1b2..8a87f153d 100644 --- a/docs/scripts/Program.cs +++ b/docs/scripts/Program.cs @@ -11,12 +11,13 @@ namespace toc { StringBuilder sb = new StringBuilder(); title = title.Trim().ToLower(); + foreach (var ch in title) { if (ch >= 'a' && ch <= 'z' || ch >= '0' && ch <= '9' - || ch == '-') + || ch == '-'|| ch =='_') sb.Append(ch); - else if (ch==' ' || ch =='_') + else if (ch == ' ' ) sb.Append('-'); } return sb.ToString(); -- cgit v1.2.3