Tk Library Source Code

View Ticket
Login
Ticket UUID: 1094294
Title: Some format cmds mangle text w/ nroff formatter
Type: Bug Version: None
Submitter: pointsman Created on: 2005-01-02 02:10:10
Subsystem: doctools Assigned To: andreas_kupries
Priority: 7 High Severity:
Status: Closed Last Modified: 2005-01-18 23:51:58
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2005-01-18 16:51:58
Description:
See this sample doctools markup (please note, that the
first sentence used in the example is in fact out of
the wild - the snitfaq.man of snit 0.97):

[manpage_begin foo n 0.97]
[description]

In this example, [cmd text] is the [term type] command and
[cmd .mytext] is the [term instance] command.
Some other explanations.

[manpage_end]

Processed with mpexpand, this nroff is generated:

'\"
'\" Generated from file foo.man' by tcllib/doctools
with format 'nroff'
'\"
.so man.macros
.TH "foo" n 0.97  ""
.BS
.SH "NAME"
foo \-
.SH "DESCRIPTION"
In this example, \fBtext\fR is the \fItype\fR command and
\fB.mytext\fR is the \fIinstance\fR command.
Some other explanations.

Viewed with man (at least under linux, man 2.3.19) the
text out of the source line starting with [cmd .mytext]
is not shown.

It is important, that the line in the document source
starts with [cmd] and that the argument given to [cmd]
starts with a dot (as widget names do, which makes it
not so unlikely, that that happes, as the real life
example shows); if [cmd] is used somewhere in the line,
the displayed man page looks OK, even if the argument
given to [cmd] starts with a dot.

It's apparently the line starting \fB. which confuses
groff. (This is just a guess, my nroff is so rusty, I
hardly remember nasty little details.) 

The [emph], [strong], [arg], [var] (and eventually
other formatting commands) have the same problem, if
used at the start of a line in the document source -
probably every markup, which is possible in continuous
text, which ends up using nr_bld, nr_ul and nr_bolds
(at least) out of _nroff.tcl.
User Comments: andreas_kupries added on 2005-01-18 23:51:58:
Logged In: YES 
user_id=75003

This has been fixed. A postprocessing step ensures that \fB.
and \fBI. do not occur at the beginning of a line. By
appending such offending lines to the end of the previous line.