kernel-doc: strip leading blank lines from inline doc comments
authorJani Nikula <jani.nikula@intel.com>
Thu, 26 May 2016 19:04:42 +0000 (22:04 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 30 May 2016 10:39:00 +0000 (13:39 +0300)
The inline member markup allows whitespace lines before the actual
documentation starts. Strip the leading blank lines. This improves the
rst output.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
scripts/kernel-doc

index a89ff3ca366ca505a73f92321057b28d79be4cae..e8ea295567a3a95d5acfde0bb03e35780d5afdee 100755 (executable)
@@ -2889,6 +2889,10 @@ sub process_file($) {
            } elsif (/$doc_content/) {
                if ($inline_doc_state == STATE_INLINE_TEXT) {
                    $contents .= $1 . "\n";
+                   # nuke leading blank lines
+                   if ($contents =~ /^\s*$/) {
+                       $contents = "";
+                   }
                } elsif ($inline_doc_state == STATE_INLINE_NAME) {
                    $inline_doc_state = STATE_INLINE_ERROR;
                    print STDERR "Warning(${file}:$.): ";