From 460a3b20aac43cf4a1deaee566125d60e250496d Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Fri, 27 Jan 2017 16:59:35 +0100 Subject: [PATCH] Don't generate doc if doc comments only filled with 'white' characters --- src/librustdoc/html/markdown.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs index f2427008a7d..8cc3b60a184 100644 --- a/src/librustdoc/html/markdown.rs +++ b/src/librustdoc/html/markdown.rs @@ -237,8 +237,9 @@ pub fn render(w: &mut fmt::Formatter, let my_opaque: &MyOpaque = &*((*opaque).opaque as *const MyOpaque); let text = (*orig_text).as_bytes(); let origtext = str::from_utf8(text).unwrap(); + let origtext = origtext.trim_left(); debug!("docblock: ==============\n{:?}\n=======", text); - let rendered = if lang.is_null() { + let rendered = if lang.is_null() || origtext.is_empty() { false } else { let rlang = (*lang).as_bytes();