summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwylite <twylite@crypt.co.za>2013-01-18 16:16:19 (GMT)
committertwylite <twylite@crypt.co.za>2013-01-18 16:16:19 (GMT)
commitc1aaf04ff3fa9392551b1c98a2d7aed9770ed9fd (patch)
tree602d188e1d4944ac46d6a73029231ec0d3379aa5
parentfa7aca61260f77597203a61c1f318f57a9665240 (diff)
downloadtcl-c1aaf04ff3fa9392551b1c98a2d7aed9770ed9fd.zip
tcl-c1aaf04ff3fa9392551b1c98a2d7aed9770ed9fd.tar.gz
tcl-c1aaf04ff3fa9392551b1c98a2d7aed9770ed9fd.tar.bz2
Fix handling of text lines starting with a period (they could be confused with directives). Fix handling of a pair of single-quotes in text (e.g. maths markup)
-rw-r--r--tools/tcltk-man2html-utils.tcl15
1 files changed, 13 insertions, 2 deletions
diff --git a/tools/tcltk-man2html-utils.tcl b/tools/tcltk-man2html-utils.tcl
index e18e73a..f94b29f 100644
--- a/tools/tcltk-man2html-utils.tcl
+++ b/tools/tcltk-man2html-utils.tcl
@@ -188,6 +188,10 @@ proc process-text {text} {
set text [string map [list "\\" "&#92;"] $text]
manerror "uncaught backslash: $text"
}
+ if {[string match ".*" $text]} {
+ # leading period could get confused for a directive later
+ set text [string replace $text 0 0 "&#46;"]
+ }
return $text
}
@@ -907,9 +911,16 @@ proc insert-cross-references {text} {
[expr {[lindex $range 1]+1}] end]
continue
}
- end-anchor - end-bold - end-quote {
+ end-anchor - end-bold {
return [reference-error "Out of place $invert([lindex $offsets 0])" $text]
}
+ end-quote {
+ # '' is valid text
+ append result ''
+ set text [string range $text[set text ""] \
+ [expr {$offset(end-quote)+1}] end]
+ continue
+ }
}
}
}
@@ -1210,7 +1221,7 @@ proc output-directive {line} {
manerror "ignoring $line"
}
default {
- manerror "unrecognized format directive: $line"
+ manerror "unrecognized directive: $line"
}
}
}