summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-07 19:55:48 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-01-07 19:55:48 (GMT)
commit9cd875fc6ff95dd063bf0d41867f9e4348b3f318 (patch)
tree35ce64fa9a649b8fdb15802be05ee2f5c4c0a532 /tools
parentc220ae0d43a2ad241eeedde1f7b0c14ed90d36b2 (diff)
parent5608e51a46c5ddb594d05a3d9cbeace701b5dcc6 (diff)
downloadtcl-9cd875fc6ff95dd063bf0d41867f9e4348b3f318.zip
tcl-9cd875fc6ff95dd063bf0d41867f9e4348b3f318.tar.gz
tcl-9cd875fc6ff95dd063bf0d41867f9e4348b3f318.tar.bz2
Merge 8.6
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>"