Tcl Source Code

View Ticket
Login
Ticket UUID: 1c722347fe2726b3544f244565efb2c53de174de
Title: Tool generate wrong links for targets containing spaces/newlines
Type: Bug Created on: 2026-10-06 21:28:20
Submitter: anonymous Assigned to: nobody
Subsystem: 53. Configuration and Build Tools Severity: Important
Priority: 5 Medium Last modified: 2026-10-21 17:17:16
Status: Open Closed by: nobody
Resolution: None Closed on:
Version: 9.1.0
Description:
tools/tcltk-man2html.tcl and tcltk-man2html-utils.tcl generate HTML files for the user documentation including cross-references and index-pages.
This tool-set writes wrong target values for several name, id and href-anchor, which results in about 580 not linked pages.
A target can not include a space or newline (e.g. command with sub-command, like "file exists").
Usually proc "nospace-text" is called, but not at every needed place (after "#").
Additionally this proc replaces only spaces.
But there are pages with more than (single) spaces and/or newlines.
At least the letter "3" is needed for keyword "3D".
My propose correct these points and add a meta-viewport in the HTML-head section.
Please see the attached ZIP with my changes (complete files, because I can't use "diff -u").
The problems of not right ordered/cascaded tags ol, dd, dl, and dt I can't solve, sorry.
Best greetings from Germany, Thomas [TWu]
User Comments:
anonymous (claiming to be Thomas [TWu]) added on 2026-10-07 20:40:54:
I'm sorry to have a left-out copy-paste mistake in the utils-script.
After the inserted opening bracket one "nospace-text " was forgotten.

serhiy.storchaka added on 2026-10-20 12:57:54:

Thank you, Thomas. The attached ZIP is not available to me, so I made the fix from your description. Confirmed on main: a link check of the HTML generated for Tcl and Tk finds 302 dead anchors and one dead page. The links in the KEYWORDS sections did not go through nospace-text, which also replaced only single spaces (some keywords contain a newline), and there was no Keywords page for "3D".

Proposed fix in branch man2html-keyword-anchors: use nospace-text for these links, map any whitespace in it, and add index pages for keywords starting with a digit. The link check then finds no dead links; otherwise only the link targets change. The meta viewport is the separate request [7f6005a867]; the nesting of ol, dd, dl and dt is not changed.


anonymous (claiming to be Thomas [TWu]) added on 2026-10-20 20:57:05:
Thank You very much, Serhiy! Unfortunately this is not the complete request. The anchors are left. Probably our URI-check found only the connection to the main commands or does not check the name=/id= values at all as local targets from other pages. I use "CSS HTML Validator 2026" to found all problems in the doc of 9.0.4 version. I save my solution to https://blindenfreizeiten.de/TCL/tools_tcltk-man2html.zip so You can make a diff. Also the line-breaks are not handled. Please have a look at it. Many thanks again, Thomas [TWu]

serhiy.storchaka added on 2026-10-20 21:48:56:

Thank you, Thomas, the ZIP is available now. Most of it was already in the branch (nospace-text maps any whitespace, including newlines, and there are Keywords pages for names starting with a digit). The remaining links now also go through nospace-text in [d61292cc5f]: the three #$here links of the tables of contents, the M$name standard option link and the #$manual(...-id-...) cross-reference. Their targets already used it, so for the current pages this makes no difference.

In the HTML that the branch generates for Tcl and Tk there are no name/id or href values with whitespace and no links to missing anchors. The published 9.0.4 pages you checked were generated before this fix: the branch is not merged yet, and it is not in 9.0. The meta viewport is in branch man2html-meta-viewport, for [7f6005a867].


anonymous (claiming to be Thomas [TWu]) added on 2026-10-21 16:26:38:
I accept the both fix-points for version 9.1.0 - thank You, Serhiy!
@Harald: Can they merged too?
I will look on the remaining dl, dd, dt and ol fails, open a new ticket on finding a solution...

serhiy.storchaka added on 2026-10-21 17:17:16:

The meta viewport is merged now, into trunk ([785fa0c704]), core-9-0-branch and core-8-6-branch.


Attachments: