fix docs_rs when there is no doc but there is an item decl

This commit is contained in:
mat 2023-12-23 02:10:17 -06:00
parent 62a6f3d5e1
commit 05299fbe46
2 changed files with 6 additions and 3 deletions

View File

@ -35,9 +35,12 @@ pub fn parse_response(body: &str, url: Url) -> Option<String> {
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
.select(&Selector::parse(".item-decl").unwrap())
.next()

View File

@ -147,7 +147,7 @@ searchInputEl.addEventListener("input", () => {
clearFocusedSuggestion();
updateSuggestions();
});
// and on focus
// and when they click suggestions
searchInputEl.addEventListener("click", updateSuggestions);
// on unfocus hide the suggestions
searchInputEl.addEventListener("blur", (e) => {