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:
parent
0bfb61ed9d
commit
e1e4816e16
3 changed files with 10 additions and 13 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue