Skip to content

Commit

Permalink
change footnote anchor formats to fix spurious rendering differences
Browse files Browse the repository at this point in the history
  • Loading branch information
QuietMisdreavus committed Oct 21, 2017
1 parent 4fdd629 commit af09ba8
Showing 1 changed file with 3 additions and 3 deletions.
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 af09ba8

Please sign in to comment.