[PATCH v2 05/39] scripts/kernel-doc: don't add not needed new lines

Mauro Carvalho Chehab posted 39 patches 11 months, 2 weeks ago
There is a newer version of this series
[PATCH v2 05/39] scripts/kernel-doc: don't add not needed new lines
Posted by Mauro Carvalho Chehab 11 months, 2 weeks ago
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 2c77b914d017..d59552e1a31d 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -760,6 +760,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