mirror of https://github.com/searxng/searxng.git
[fix] respect user preferences to open links in new tab for short answers
Previously only result urls were set to open in new tab by default, this should make the behaviour consistent. Also adds the missing rel="noreferrer" to the anchor tag. Although this should not be needed as long as the `referrer-policy: no-referrer` header is set, it's always nice to play safer than to have to say sorry. For example some reverse proxy configurations might strip off unwhitelisted headers in which case it's nice to have this set.
This commit is contained in:
parent
78077126f2
commit
d577817646
|
@ -24,8 +24,12 @@
|
||||||
{%- for answer in answers.values() -%}
|
{%- for answer in answers.values() -%}
|
||||||
<div class="answer">
|
<div class="answer">
|
||||||
<span>{{ answer.answer }}</span>
|
<span>{{ answer.answer }}</span>
|
||||||
{% if answer.url -%}
|
{%- if answer.url -%}
|
||||||
<a href="{{ answer.url }}" class="answer-url">{{ urlparse(answer.url).hostname }}</a>
|
<a href="{{ answer.url }}" class="answer-url"
|
||||||
|
{%- if results_on_new_tab %} target="_blank" rel="noopener noreferrer"
|
||||||
|
{%- else -%} rel="noreferrer"
|
||||||
|
{%- endif -%}
|
||||||
|
>{{ urlparse(answer.url).hostname }}</a>
|
||||||
{% endif -%}
|
{% endif -%}
|
||||||
</div>
|
</div>
|
||||||
{%- endfor -%}
|
{%- endfor -%}
|
||||||
|
|
Loading…
Reference in New Issue