diff options
author | twylite <twylite@crypt.co.za> | 2013-01-18 16:16:19 (GMT) |
---|---|---|
committer | twylite <twylite@crypt.co.za> | 2013-01-18 16:16:19 (GMT) |
commit | c1aaf04ff3fa9392551b1c98a2d7aed9770ed9fd (patch) | |
tree | 602d188e1d4944ac46d6a73029231ec0d3379aa5 | |
parent | fa7aca61260f77597203a61c1f318f57a9665240 (diff) | |
download | tcl-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.tcl | 15 |
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 "\\" "\"] $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 "."] + } 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" } } } |