Commit 177c7a7d authored by Martin Koller's avatar Martin Koller

Do not insert a break before the very first Nm in section SYNOPSIS

parent c7a5f6b1
......@@ -5317,17 +5317,22 @@ static char *scan_request(char *c)
if ( mandoc_name.isEmpty() && args.count() )
mandoc_name = args[0];
out_html(set_font("B"));
if ( mandoc_synopsis && mandoc_name_count )
if ( mandoc_synopsis )
{
/* Break lines only in the Synopsis.
* The Synopsis section seems to be treated
* as a special case - Bummer!
* Do not insert a break before the very first Nm in this section
*/
out_html("<BR>");
if ( mandoc_name_count )
out_html("<BR>");
mandoc_name_count++;
}
out_html(set_font("B"));
// only show name if
// .Nm (first not-null-length defined name)
// .Nm name
......@@ -5341,52 +5346,7 @@ static char *scan_request(char *c)
c = scan_troff_mandoc(argPointers[0], 1, 0);
}
mandoc_name_count++;
out_html(set_font("R"));
#if 0
if (mandoc_synopsis && mandoc_name_count)
{
/* Break lines only in the Synopsis.
* The Synopsis section seems to be treated
* as a special case - Bummer!
*/
out_html("<BR>");
}
else if (!mandoc_name_count)
{
const char *nextbreak = strchr(c, '\n');
const char *nextspace = strchr(c, ' ');
if (nextspace < nextbreak)
nextbreak = nextspace;
if (nextbreak)
{
/* Remember the name for later. */
mandoc_name = QByteArray(c, nextbreak - c);
}
}
mandoc_name_count++;
out_html(set_font("B"));
// ### FIXME: fill_words must be used
while (*c == ' ' || *c == '\t') c++;
if ((tolower(*c) >= 'a' && tolower(*c) <= 'z') || (*c >= '0' && *c <= '9'))
{
// alphanumeric argument
c = scan_troff_mandoc(c, 1, NULL);
out_html(set_font("R"));
out_html(NEWLINE);
}
else
{
/* If Nm has no argument, use one from an earlier
* Nm command that did have one. Hope there aren't
* too many commands that do this.
*/
out_html(mandoc_name);
out_html(set_font("R"));
}
#endif
if (fillout)
curpos++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment