1
Fork 0

rustdoc: whitelist the headers that get a § on hover.

Previously the :hover rules were making the links to the traits/types in
something like

    impl<K: Hash + Eq, V> ... { ... }

be displayed with a trailing `§` when hovered over. This commit
restricts that behaviour to specific headers, i.e. those that are known
to be section headers (like those rendered in markdown doc-comments, and
the "Modules", "Functions" etc. headings).
This commit is contained in:
Huon Wilson 2014-03-12 23:09:03 +11:00 committed by Alex Crichton
parent 0bfb61ed9d
commit e1e4816e16
3 changed files with 10 additions and 13 deletions

View file

@ -1064,7 +1064,9 @@ fn item_module(w: &mut Writer, cx: &Context,
clean::ForeignStaticItem(..) => ("ffi-statics", "Foreign Statics"),
clean::MacroItem(..) => ("macros", "Macros"),
};
try!(write!(w, "<h2 id='{id}'><a href=\"\\#{id}\">{name}</a></h2>\n<table>",
try!(write!(w,
"<h2 id='{id}' class='section-link'>\
<a href=\"\\#{id}\">{name}</a></h2>\n<table>",
id = short, name = name));
}