Prevent urls in headings
This commit is contained in:
parent
bf84eb538f
commit
1bf9f69579
2 changed files with 18 additions and 2 deletions
|
@ -380,7 +380,11 @@ impl<'a, 'b, 'ids, I: Iterator<Item = Event<'a>>> Iterator for HeadingLinks<'a,
|
|||
}
|
||||
_ => {}
|
||||
}
|
||||
self.buf.push_back(event);
|
||||
match event {
|
||||
Event::Start(Tag::Link(_, _, text)) => self.buf.push_back(Event::Text(text)),
|
||||
Event::End(Tag::Link(..)) => {}
|
||||
event => self.buf.push_back(event),
|
||||
}
|
||||
}
|
||||
let id = self.id_map.derive(id);
|
||||
|
||||
|
|
12
src/test/rustdoc/remove-url-from-headings.rs
Normal file
12
src/test/rustdoc/remove-url-from-headings.rs
Normal file
|
@ -0,0 +1,12 @@
|
|||
#![crate_name = "foo"]
|
||||
|
||||
// @has foo/fn.foo.html
|
||||
// !@has - '//a[@href="http://a.a"]'
|
||||
// @has - '//a[@href="#implementing-stuff-somewhere"]' 'Implementing stuff somewhere'
|
||||
|
||||
/// fooo
|
||||
///
|
||||
/// # Implementing [stuff](http://a.a) somewhere
|
||||
///
|
||||
/// hello
|
||||
pub fn foo() {}
|
Loading…
Add table
Add a link
Reference in a new issue