From 6f6f1ba7ad445aa65792467cae8007c0ecb0f888 Mon Sep 17 00:00:00 2001 From: Yaksh Bariya Date: Thu, 2 May 2024 15:44:45 +0530 Subject: [PATCH] [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. --- searx/templates/simple/results.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/searx/templates/simple/results.html b/searx/templates/simple/results.html index 7d97c9e06..52b474c77 100644 --- a/searx/templates/simple/results.html +++ b/searx/templates/simple/results.html @@ -24,8 +24,12 @@ {%- for answer in answers.values() -%}
{{ answer.answer }} - {% if answer.url -%} - {{ urlparse(answer.url).hostname }} + {%- if answer.url -%} + {{ urlparse(answer.url).hostname }} {% endif -%}
{%- endfor -%}