Allow creation of src-links for device files

This commit is contained in:
mitaa 2016-02-24 19:40:16 +01:00
parent 37c6f2881c
commit 27ca2507de

View File

@ -1489,9 +1489,11 @@ impl<'a> Item<'a> {
true, |component| {
path.push(component.to_string());
});
// If the span points into an external macro the
// source-file will be bogus, i.e `<foo macros>`
if Path::new(&self.item.source.filename).is_file() {
let filename = &self.item.source.filename;
if !(filename.starts_with("<") && filename.ends_with("macros>")) {
Some(format!("{root}src/{krate}/{path}.html#{href}",
root = self.cx.root_path,
krate = self.cx.layout.krate,