| Description: |
The bugs below were found by the tests in branch tests-shtmlview; each is covered by a test with the knownBug constraint (shtmlview-1.8, 2.2, 2.7, 2.13, 3.16.1, 3.19, 4.8, 5.9, 5.11, 5.12, 6.8, 9.11, 11.1.1). All of them occur with both Tk 8.6 and Tk 9.1.
- package require shtmlview::shtmlview fails with can't read "argv": no such variable when ::argv0 exists but ::argv does not (as in the sak test harness): the check at the top of shtmlview.tcl reads [lindex $argv 0] whenever argv0 exists. Test shtmlview-1.8.
- -closebutton: the option has no default value, so cget -closebutton returns an empty string although the close button is shown (the manual page says the default is true). In addition, configureClosebutton stores the value in options(-toolbar): after configure -closebutton false, cget -closebutton still returns an empty string and cget -toolbar returns false (the toolbar itself stays visible). Tests shtmlview-2.2, 2.7.
- -browsecmd is invoked as $options(-browsecmd) $ourl, so a command prefix with arguments does not work: -browsecmd {lappend ::Log} fails with invalid command name "lappend ::Log". The manual page says the URL is appended as an argument to the command. Test shtmlview-2.13.
- browse file.html#anchor as the first page displays nothing: method browse sets lasturl to the URL with the anchor before calling render, which then takes it for a jump inside the already displayed page and only calls HMgoto. Test shtmlview-3.16.1.
- Browsing the same page twice (browse $A; browse $A) breaks the history: pushcurrenttopic does not append the page because it is already the last one, but increments the history index anyway, so url returns an empty string afterwards. Test shtmlview-3.19.
- Method render uses [file tempfile].$ext as the file name: the channel returned by file tempfile is never closed (one channel leaks per call), and the temporary file is written to the current directory under a name like file5.html. Test shtmlview-4.8.
- Method home always displays the first page of the history and ignores -home, although the manual page says it displays the page set by -home. Test shtmlview-5.9.
- getHistory and getFiles use [list $topicstack {*}$stack], so the whole history is returned as a single list element. Consequently getFiles neither removes duplicates nor anchors correctly (after browsing a.html, a.html#sec, b.html, a.html it returns one element {a.html a.html} instead of a.html b.html). Tests shtmlview-5.11, 5.12.
- The manual page documents a method getEditWidget, but it does not exist: unknown subcommand "getEditWidget". Test shtmlview-6.8.
- The manual page says key p moves to the previous search match, but the code binds <m> (and nothing to p). Test shtmlview-9.11.
- shtmlview::mkdoc requires the package mkdoc::mkdoc, but Tcllib provides the mkdoc command in the package mkdoc, so package require shtmlview::mkdoc fails with can't find package mkdoc::mkdoc even when Tcllib's mkdoc is installed. Test shtmlview-11.1.1.
|
| User Comments: |
serhiy.storchaka added on 2026-11-22 15:52:43:
Proposed fix for loading shtmlview::shtmlview without ::argv and for shtmlview::mkdoc in branch shtmlview-load-fixes. Besides the package name, shtmlview::mkdoc also passed -html to mkdoc::mkdoc, which Tcllib's version rejects, so rendering mkdoc files did not work either.
|