]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #23351 - nagisa:rustdoc-lines-2, r=alexcrichton
authorbors <bors@rust-lang.org>
Sun, 15 Mar 2015 03:11:14 +0000 (03:11 +0000)
committerbors <bors@rust-lang.org>
Sun, 15 Mar 2015 03:11:14 +0000 (03:11 +0000)
Previously it would fail on a trivial case like

    /// Summary line
    /// <trailing space>
    /// Regular content

Compliant markdown preprocessor would render that as two separate paragraphs, but our summary line
extractor interprets both lines as the same paragraph and includes both into the short summary resulting in
![screenshot from 2015-03-13 22 47 08](https://cloud.githubusercontent.com/assets/679122/6648596/7ef792b2-c9e4-11e4-9c19-704c288ec4de.png)

1  2 
src/librustdoc/html/render.rs

index 4c6341efb72c73430317e35b73411692aee8344b,85c04d76394a5112f3444a03a224c0b8c1455e35..f97470dbaed758d885165bed8c20e67c334d0c98
@@@ -453,9 -407,8 +453,9 @@@ fn build_index(krate: &clean::Crate, ca
                          ty: shortty(item),
                          name: item.name.clone().unwrap(),
                          path: fqp[..fqp.len() - 1].connect("::"),
-                         desc: shorter(item.doc_value()).to_string(),
+                         desc: shorter(item.doc_value()),
                          parent: Some(did),
 +                        search_type: None,
                      });
                  },
                  None => {}
@@@ -935,9 -876,8 +935,9 @@@ impl DocFolder for Cache 
                          ty: shortty(&item),
                          name: s.to_string(),
                          path: path.connect("::").to_string(),
-                         desc: shorter(item.doc_value()).to_string(),
+                         desc: shorter(item.doc_value()),
                          parent: parent,
 +                        search_type: get_index_search_type(&item, parent_basename),
                      });
                  }
                  (Some(parent), None) if is_method || (!self.privmod && !hidden_field)=> {