fix docs_rs when there is no doc but there is an item decl
This commit is contained in:
parent
62a6f3d5e1
commit
05299fbe46
@ -35,9 +35,12 @@ pub fn parse_response(body: &str, url: Url) -> Option<String> {
|
|||||||
|
|
||||||
let doc_query = Selector::parse(".docblock").unwrap();
|
let doc_query = Selector::parse(".docblock").unwrap();
|
||||||
|
|
||||||
let doc = dom.select(&doc_query).next()?;
|
let doc_html = dom
|
||||||
|
.select(&doc_query)
|
||||||
|
.next()
|
||||||
|
.map(|doc| doc.inner_html())
|
||||||
|
.unwrap_or_default();
|
||||||
|
|
||||||
let doc_html = doc.inner_html();
|
|
||||||
let item_decl = dom
|
let item_decl = dom
|
||||||
.select(&Selector::parse(".item-decl").unwrap())
|
.select(&Selector::parse(".item-decl").unwrap())
|
||||||
.next()
|
.next()
|
||||||
|
@ -147,7 +147,7 @@ searchInputEl.addEventListener("input", () => {
|
|||||||
clearFocusedSuggestion();
|
clearFocusedSuggestion();
|
||||||
updateSuggestions();
|
updateSuggestions();
|
||||||
});
|
});
|
||||||
// and on focus
|
// and when they click suggestions
|
||||||
searchInputEl.addEventListener("click", updateSuggestions);
|
searchInputEl.addEventListener("click", updateSuggestions);
|
||||||
// on unfocus hide the suggestions
|
// on unfocus hide the suggestions
|
||||||
searchInputEl.addEventListener("blur", (e) => {
|
searchInputEl.addEventListener("blur", (e) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user