From: Jani Nikula Date: Thu, 26 May 2016 19:04:42 +0000 (+0300) Subject: kernel-doc: strip leading blank lines from inline doc comments X-Git-Tag: v4.8-rc1~3^2~37^2~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6450c8957ee3a8f58191c2ed6c5b71c7b7d1b310;p=platform%2Fkernel%2Flinux-exynos.git kernel-doc: strip leading blank lines from inline doc comments 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 --- diff --git a/scripts/kernel-doc b/scripts/kernel-doc index a89ff3c..e8ea295 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -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}:$.): ";