Skip to content

Commit

Permalink
Rollup merge of rust-lang#45421 - QuietMisdreavus:update-pulldown, r=…
Browse files Browse the repository at this point in the history
…steveklabnik

rustdoc: update pulldown + fix spurious rendering difference around footnotes

fixes rust-lang#45420
  • Loading branch information
frewsxcv authored Oct 28, 2017
2 parents 0aad849 + af09ba8 commit e814f75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
17 changes: 1 addition & 16 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/librustdoc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ doctest = false
[dependencies]
env_logger = { version = "0.4", default-features = false }
log = "0.3"
pulldown-cmark = { version = "0.0.14", default-features = false }
pulldown-cmark = { version = "0.1.0", default-features = false }
html-diff = "0.0.4"

[build-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions src/librustdoc/html/markdown.rs
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for Footnotes<'a, I> {
match self.inner.next() {
Some(Event::FootnoteReference(ref reference)) => {
let entry = self.get_entry(&reference);
let reference = format!("<sup id=\"supref{0}\"><a href=\"#ref{0}\">{0}\
let reference = format!("<sup id=\"fnref{0}\"><a href=\"#fn{0}\">{0}\
</a></sup>",
(*entry).1);
return Some(Event::Html(reference.into()));
Expand All @@ -394,15 +394,15 @@ impl<'a, I: Iterator<Item = Event<'a>>> Iterator for Footnotes<'a, I> {
v.sort_by(|a, b| a.1.cmp(&b.1));
let mut ret = String::from("<div class=\"footnotes\"><hr><ol>");
for (mut content, id) in v {
write!(ret, "<li id=\"ref{}\">", id).unwrap();
write!(ret, "<li id=\"fn{}\">", id).unwrap();
let mut is_paragraph = false;
if let Some(&Event::End(Tag::Paragraph)) = content.last() {
content.pop();
is_paragraph = true;
}
html::push_html(&mut ret, content.into_iter());
write!(ret,
"&nbsp;<a href=\"#supref{}\" rev=\"footnote\">↩</a>",
"&nbsp;<a href=\"#fnref{}\" rev=\"footnote\">↩</a>",
id).unwrap();
if is_paragraph {
ret.push_str("</p>");
Expand Down

0 comments on commit e814f75

Please sign in to comment.