From c280010d8b139303470fc3534c38e7d663376d78 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 29 Aug 2024 23:59:17 +0200 Subject: [PATCH] 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 --- scripts/managen | 2 ++ tests/data/test1705 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) 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