Skip to content

Commit

Permalink
Move read more link to same line
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed May 18, 2016
1 parent 8e94b04 commit 74633b0
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1659,11 +1659,12 @@ fn document(w: &mut fmt::Formatter, cx: &Context, item: &clean::Item) -> fmt::Re

fn document_short(w: &mut fmt::Formatter, item: &clean::Item, link: AssocItemLink) -> fmt::Result {
if let Some(s) = item.doc_value() {
write!(w, "<div class='docblock'>{}", Markdown(&plain_summary_line(Some(s))))?;
if s.contains('\n') {
write!(w, "<a href='{}'>Read more</a>", naive_assoc_href(item, link))?;
}
write!(w, "</div>")?;
let markdown = if s.contains('\n') {
format!("{} [Read more]({})", &plain_summary_line(Some(s)), naive_assoc_href(item, link))
} else {
format!("{}", &plain_summary_line(Some(s)))
};
write!(w, "<div class='docblock'>{}</div>", Markdown(&markdown))?;
}
Ok(())
}
Expand Down

0 comments on commit 74633b0

Please sign in to comment.