]> Git repositories of Nishi - koakuma.git/commitdiff
avoid using bracket in id
authorNishi <nishi@nishi.boats>
Wed, 2 Oct 2024 09:56:33 +0000 (09:56 +0000)
committerNishi <nishi@nishi.boats>
Wed, 2 Oct 2024 09:56:33 +0000 (09:56 +0000)
git-svn-id: file:///raid/svn-personal/koakuma/trunk@39 219d0f9c-2d94-d447-890a-813e76b88fe9

koakuma.cgi.in

index 3fe1ef14c97d9eea467077e0f016d82294957323..8026a0e662cfc4ac4325a4a6ae21e7f8c627f964 100644 (file)
@@ -280,7 +280,7 @@ proc start_html {title has_toc} {
                rputs   "                       <div id=\"tocinside\">"
                rputs   "                               <span id=\"toctitle\">TOC</span><hr>"
                foreach sect $toc {
-                       if { "[string range "[regsub -all { } "$sect" "-"]" 0 0]" == "-" } {
+                       if { "[string range "[sanitize "$sect"]" 0 0]" == "-" } {
                                rputs "<a class=\"shiftlink\" href=\"#TOC-[sanitize "[regsub {^-} "$sect" ""]"]\">[regsub {^-} "$sect" ""]</a><br>"
                        } else {
                                rputs "<a href=\"#TOC-[sanitize "$sect"]\">$sect</a><br>"
@@ -308,7 +308,7 @@ proc end_html {has_toc} {
 
 proc add_toc {data} {
        global toc
-       tputs   "<h2 id=\"TOC-[sanitize "$data"]\"><a href=\"#TOC-[sanitize "$data" "-"]\">#</a> $data</h2>"
+       tputs   "<h2 id=\"TOC-[sanitize "$data"]\"><a href=\"#TOC-[sanitize "$data"]\">#</a> $data</h2>"
        lappend toc "$data"
 }