File tree 3 files changed +5
-5
lines changed
static-src/core/js/doc-embed
3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ function attach_elastic_search_query(data) {
83
83
if ( 'BUILDER' in DOCUMENTATION_OPTIONS && DOCUMENTATION_OPTIONS . BUILDER === 'readthedocsdirhtml' ) {
84
84
suffix = '' ;
85
85
}
86
- var link = doc . link + suffix ;
86
+ var link = doc . link + suffix + "?highlight=" + $ . urlencode ( query ) ;
87
87
88
88
var item = $ ( '<a>' , { 'href' : link } ) ;
89
89
Original file line number Diff line number Diff line change @@ -180,14 +180,14 @@ <h3>
180
180
181
181
{% elif 'page' in result.meta.index %}
182
182
{% with "100" as MAX_SUBSTRING_LIMIT %}
183
- < a href ="{% doc_url result.project|get_project result.version result.full_path %} ">
183
+ < a href ="{% doc_url result.project|get_project result.version result.full_path %}?highlight={{ query }} ">
184
184
{{ result.project }} - {% if result.meta.highlight.title %} {{ result.meta.highlight.title.0|safe }} {% else %} {{ result.title }} {% endif %}
185
185
</ a >
186
186
187
187
{% for inner_hit in result.meta.inner_hits %}
188
188
{% if inner_hit.type == 'domains' %}
189
189
< p >
190
- < a href ="{% doc_url result.project|get_project result.version result.full_path %}#{{ inner_hit.source.anchor }} ">
190
+ < a href ="{% doc_url result.project|get_project result.version result.full_path %}?highlight={{ query }} #{{ inner_hit.source.anchor }} ">
191
191
{% if inner_hit.highlight|get_key_or_none:"domains.name" %}
192
192
{% with domain_name=inner_hit.highlight|get_key_or_none:"domains.name" %}
193
193
[{{ inner_hit.source.role_name }}]: {{ domain_name.0|safe }}
211
211
212
212
{% elif inner_hit.type == 'sections' %}
213
213
< p >
214
- < a href ="{% doc_url result.project|get_project result.version result.full_path %}#{{ inner_hit.source.id }} ">
214
+ < a href ="{% doc_url result.project|get_project result.version result.full_path %}?highlight={{ query }} #{{ inner_hit.source.id }} ">
215
215
{% if inner_hit.highlight|get_key_or_none:"sections.title" %}
216
216
{% with section_title=inner_hit.highlight|get_key_or_none:"sections.title" %}
217
217
{{ section_title.0|safe }}
You can’t perform that action at this time.
0 commit comments