>();
// 4 nodes containing example requests in different languages.
// TODO: Skip for now
let mut count = 0;
let mut element = element;
loop {
let (fragment, new_element) = next(element);
element = new_element;
if fragment
.select(&selector(r#"div[class="highlight"]"#))
.next()
.is_none()
{
break;
}
count += 1;
if count == 10 {
panic!("Too many examples");
}
}
if count == 0 && name != "api-status" {
panic!("No examples for {}", name);
}
None
}
fn next(element: ElementRef) -> (Html, ElementRef) {
let element = element.next_sibling_element().unwrap();
let html = Html::parse_fragment(&element.html());
(html, element)
}
fn selector(s: &str) -> Selector {
Selector::parse(s).unwrap()
}