Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustdoc: update pulldown + fix spurious rendering difference around footnotes #45421

Merged
merged 2 commits into from
Oct 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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