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

From
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Date
2025-02-13 12:06:28
Also in
lkml
Reply to
Mauro Carvalho Chehab, 2025-02-13
This helps comparing kernel-doc output with the new .py version
of it.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 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
Thread (10 messages) 10 messages, 3 authors, last reply 2025-02-14
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help