Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Remove 'highlight' URL param from search results #43

Merged
merged 1 commit into from
Aug 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions sphinx_search/static/js/rtd_sphinx_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ const generateSingleResult = (resultData, projectName) => {
</a>';

let page_link = `${resultData.link}${DOCUMENTATION_OPTIONS.FILE_SUFFIX}`;
let page_link_highlight =
page_link + "?highlight=" + encodeURIComponent(SEARCH_QUERY);

let page_title = resultData.title;

// if title is present in highlighted field, use that.
Expand Down Expand Up @@ -374,7 +371,7 @@ const generateSingleResult = (resultData, projectName) => {
page_title += "<br>";

content.innerHTML += $u.template(page_link_template, {
page_link: page_link_highlight,
page_link: page_link,
page_title: page_title
});

Expand All @@ -386,12 +383,12 @@ const generateSingleResult = (resultData, projectName) => {
if (type === "sections") {
html_structure = get_section_html(
resultData.inner_hits[i],
page_link_highlight
page_link
);
} else if (type === "domains") {
html_structure = get_domain_html(
resultData.inner_hits[i],
page_link_highlight
page_link
);
}
content.innerHTML += html_structure;
Expand Down Expand Up @@ -823,6 +820,8 @@ window.addEventListener("DOMContentLoaded", evt => {
search_outer_input.dispatchEvent(event);
}
} else {
console.log("[INFO] Docs are not being served on Read the Docs, readthedocs-sphinx-search will not work.")
console.log(
"[INFO] Docs are not being served on Read the Docs, readthedocs-sphinx-search will not work."
);
}
});
Loading