summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-09 17:09:56 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-09 17:09:56 (GMT)
commit1a567dbf84dd441c71e4fe4f598d21a291cda91b (patch)
tree489f53b096419107562ac184dc191b268a38e750 /tools
parentb714d266298b18489995ea64d1ebf37b7b51fe5c (diff)
parent2161463b5bc87cbef712465067c0b4fde52a699d (diff)
downloadtcl-1a567dbf84dd441c71e4fe4f598d21a291cda91b.zip
tcl-1a567dbf84dd441c71e4fe4f598d21a291cda91b.tar.gz
tcl-1a567dbf84dd441c71e4fe4f598d21a291cda91b.tar.bz2
Merge 8.7
Diffstat (limited to 'tools')
-rw-r--r--tools/tcltk-man2html-utils.tcl24
1 files changed, 17 insertions, 7 deletions
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index 98bbf86..78aa8ec 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -889,7 +889,9 @@ proc insert-cross-references {text} {
}
switch -exact -- $invert([lindex $offsets 1]) {
end-quote {
- append result [string range $text 0 [expr {$offset(quote)-1}]]
+ if {$offset(quote) > 0} {
+ append result [string range $text 0 [expr {$offset(quote)-1}]]
+ }
set body [string range $text [expr {$offset(quote)+2}] \
[expr {$offset(end-quote)-1}]]
set text [string range $text[set text ""] \
@@ -916,8 +918,10 @@ proc insert-cross-references {text} {
}
switch -exact -- $invert([lindex $offsets 1]) {
url - end-bold {
- append result \
- [string range $text 0 [expr {$offset(bold)-1}]]
+ if {$offset(bold) > 0} {
+ append result \
+ [string range $text 0 [expr {$offset(bold)-1}]]
+ }
set body [string range $text [expr {$offset(bold)+3}] \
[expr {$offset(end-bold)-1}]]
set text [string range $text[set text ""] \
@@ -939,8 +943,10 @@ proc insert-cross-references {text} {
}
}
c.tk - c.ttk - c.tcl - c.tdbc - c.itcl {
- append result [string range $text 0 \
- [expr {[lindex $offsets 0]-1}]]
+ if {[lindex $offsets 0] > 0} {
+ append result [string range $text 0 \
+ [expr {[lindex $offsets 0]-1}]]
+ }
regexp -indices -start [lindex $offsets 0] {\w+} $text range
set body [string range $text {*}$range]
set text [string range $text[set text ""] \
@@ -950,14 +956,18 @@ proc insert-cross-references {text} {
}
Tcl1 - Tcl2 {
set off [lindex $offsets 0]
- append result [string range $text 0 [expr {$off-1}]]
+ if {$off > 0} {
+ append result [string range $text 0 [expr {$off-1}]]
+ }
set text [string range $text[set text ""] [expr {$off+3}] end]
append result [cross-reference Tcl]
continue
}
url {
set off [lindex $offsets 0]
- append result [string range $text 0 [expr {$off-1}]]
+ if {$off > 0} {
+ append result [string range $text 0 [expr {$off-1}]]
+ }
regexp -indices -start $off {http://[\w/.-]+} $text range
set url [string range $text {*}$range]
append result "<a href=\"[string trimright $url .]\">$url</a>"