managen: fix superfluous leading blank line in quoted sections

When a markdown quoted section using 4-space indentation was converted
to nroff, managen previously caused a newline to appear after the
leading .nf. This fix makes sure that newline is inserted *before* .nf
as intended.

This is perhaps most notable in the HTML version of rendered manpages if
the quoted sections use different colors or similar.

Closes #14732
This commit is contained in:
Daniel Stenberg 2024-08-29 23:59:17 +02:00
parent 430af3fb59
commit c280010d8b
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 3 additions and 1 deletions

View File

@ -374,7 +374,9 @@ sub render {
elsif($d =~ /^ (.*)/) {
my $word = $1;
if(!$quote && $manpage) {
push @desc, "\n" if($blankline);
push @desc, ".nf\n";
$blankline = 0;
}
$quote = 1;
$d = "$word\n";

View File

@ -222,8 +222,8 @@ sensitive data, including usernames, credentials or secret data content. Be
aware and be careful when sharing trace logs with others.
End with a quote
.nf
.nf
hello
.fi