Skip to content

Commit 46be597

Browse files
authored
Merge pull request readthedocs#6087 from dojutsu-user/remove-highlight-url-params
Remove 'highlight' URL param from search results
2 parents 01ef334 + d7e64f4 commit 46be597

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

readthedocs/core/static-src/core/js/doc-embed/search.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ function attach_elastic_search_query(data) {
7777
}
7878

7979
// Creating the result from elements
80-
var link = doc.link + DOCUMENTATION_OPTIONS.FILE_SUFFIX + "?highlight=" + $.urlencode(query);
80+
var link = doc.link + DOCUMENTATION_OPTIONS.FILE_SUFFIX;
81+
8182
var item = $('<a>', {'href': link});
8283

8384
item.html(title);

readthedocs/core/static/core/js/readthedocs-doc-embed.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

readthedocs/templates/search/elastic_search.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,14 +180,14 @@ <h3>
180180

181181
{% elif 'page' in result.meta.index %}
182182
{% with "100" as MAX_SUBSTRING_LIMIT %}
183-
<a href="{% doc_url result.project|get_project result.version result.full_path %}?highlight={{ query }}">
183+
<a href="{% doc_url result.project|get_project result.version result.full_path %}">
184184
{{ result.project }} - {% if result.meta.highlight.title %} {{ result.meta.highlight.title.0|safe }} {% else %} {{ result.title }} {% endif %}
185185
</a>
186186

187187
{% for inner_hit in result.meta.inner_hits %}
188188
{% if inner_hit.type == 'domains' %}
189189
<p>
190-
<a href="{% doc_url result.project|get_project result.version result.full_path %}?highlight= {{ query }}#{{ inner_hit.source.anchor }}">
190+
<a href="{% doc_url result.project|get_project result.version result.full_path %}#{{ inner_hit.source.anchor }}">
191191
{% if inner_hit.highlight|get_key_or_none:"domains.name" %}
192192
{% with domain_name=inner_hit.highlight|get_key_or_none:"domains.name" %}
193193
[{{ inner_hit.source.role_name }}]: {{ domain_name.0|safe }}
@@ -211,7 +211,7 @@ <h3>
211211

212212
{% elif inner_hit.type == 'sections' %}
213213
<p>
214-
<a href="{% doc_url result.project|get_project result.version result.full_path %}?highlight={{ query }}#{{ inner_hit.source.id }}">
214+
<a href="{% doc_url result.project|get_project result.version result.full_path %}#{{ inner_hit.source.id }}">
215215
{% if inner_hit.highlight|get_key_or_none:"sections.title" %}
216216
{% with section_title=inner_hit.highlight|get_key_or_none:"sections.title" %}
217217
{{ section_title.0|safe }}

0 commit comments

Comments
 (0)