Skip to content

Commit 0b3bc9b

Browse files
committed
Correct plain-summary-line
For plaintext we don't actually need to render the Markdown before shortening the string. (and this may have led to wrong output)
1 parent 2352c1c commit 0b3bc9b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustdoc/html/render.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1657,8 +1657,8 @@ fn shorter<'a>(s: Option<&'a str>) -> String {
16571657

16581658
#[inline]
16591659
fn plain_summary_line(s: Option<&str>) -> String {
1660-
let md = markdown::plain_summary_line(s.unwrap_or(""));
1661-
shorter(Some(&md)).replace("\n", " ")
1660+
let line = shorter(s).replace("\n", " ");
1661+
markdown::plain_summary_line(&line[..])
16621662
}
16631663

16641664
fn document(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item) -> fmt::Result {

0 commit comments

Comments
 (0)