[PATCH RFCv2 3/5] scripts/kernel-doc: don't add not needed new lines

From: Mauro Carvalho Chehab
Date: Thu Feb 13 2025 - 07:06:47 EST


This helps comparing kernel-doc output with the new .py version
of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@xxxxxxxxxx>
---
scripts/kernel-doc | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 70da9a3369c6..0dfee1c3d365 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -816,6 +816,10 @@ sub output_highlight_rst {
if ($block) {
$output .= highlight_block($block);
}
+
+ $output =~ s/^\n+//g;
+ $output =~ s/\n+$//g;
+
foreach $line (split "\n", $output) {
print $lineprefix . $line . "\n";
}
--
2.48.1