Remove Notable Traits section from definitions
Rust 1.47.0 introduced the Notable Traits section that lists information about types used in code block. As we only want to display the code block itself without meta-information, this patch ignores the notable-traits class when extracting the text from nodes.
This commit is contained in:
parent
9832c22b4d
commit
ce06129976
@ -15,6 +15,7 @@ SPDX-License-Identifier: MIT
|
||||
- Add interactive tui viewer that adds support for following links from the
|
||||
documentation.
|
||||
- Add tests for Rust 1.47.0.
|
||||
- Remove Notable Traits section from definitions.
|
||||
|
||||
## v0.3.0 (2020-09-11)
|
||||
|
||||
|
@ -186,6 +186,12 @@ fn node_to_text(node: &kuchiki::NodeRef) -> String {
|
||||
}
|
||||
|
||||
fn push_node_to_text(s: &mut String, node: &kuchiki::NodeRef) {
|
||||
if node.has_class("notable-traits") {
|
||||
// The notable-traits element lists informations about types in a code block. But we only
|
||||
// want to extract the code, so we skip this element.
|
||||
return;
|
||||
}
|
||||
|
||||
let is_docblock = node.has_class("docblock");
|
||||
|
||||
let add_newline = if node.is_element(&local_name!("br")) {
|
||||
|
Loading…
Reference in New Issue
Block a user