From: Daniel Stenberg Date: Thu, 29 Aug 2024 21:59:17 +0000 (+0200) Subject: managen: fix superfluous leading blank line in quoted sections X-Git-Tag: curl-8_10_0~79 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c280010d8b139303470fc3534c38e7d663376d78;p=thirdparty%2Fcurl.git 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 --- diff --git a/scripts/managen b/scripts/managen index d816f002f0..2a1c1d9f8e 100755 --- a/scripts/managen +++ b/scripts/managen @@ -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"; diff --git a/tests/data/test1705 b/tests/data/test1705 index af2263da39..21bc70e307 100644 --- a/tests/data/test1705 +++ b/tests/data/test1705 @@ -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