From 330d56bba9dfc1c7cfd1bcf027d092bc73d1ed10 Mon Sep 17 00:00:00 2001 From: Bnyro Date: Wed, 6 May 2026 09:29:20 +0200 Subject: [PATCH] [mod] result templates: move iframe to macro and fix page rendering for non-YouTube links (#5960) This PR moves the `iframe` logic into a macro, so that `videos.html` and `general.html` both can benefit from the workaround to fix YouTube results by @return42 in https://github.com/searxng/searxng/pull/5858 It also fixes that only YouTube videos contained the closing `>` after ` +{%- endmacro -%} diff --git a/searx/templates/simple/result_templates/default.html b/searx/templates/simple/result_templates/default.html index 82d902933..f678c0c52 100644 --- a/searx/templates/simple/result_templates/default.html +++ b/searx/templates/simple/result_templates/default.html @@ -1,4 +1,4 @@ -{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} +{% from 'simple/macros.html' import iframe, result_header, result_sub_header, result_sub_footer, result_footer with context %} {{ result_header(result, favicons, image_proxify) -}} {{- result_sub_header(result) -}} @@ -17,7 +17,7 @@ {{- result_sub_footer(result) -}} {% if result.iframe_src -%} {%- endif %} {% if result.audio_src -%} diff --git a/searx/templates/simple/result_templates/videos.html b/searx/templates/simple/result_templates/videos.html index dcd127679..a336c25ed 100644 --- a/searx/templates/simple/result_templates/videos.html +++ b/searx/templates/simple/result_templates/videos.html @@ -1,4 +1,4 @@ -{% from 'simple/macros.html' import result_header, result_sub_header, result_sub_footer, result_footer with context %} +{% from 'simple/macros.html' import iframe, result_header, result_sub_header, result_sub_footer, result_footer with context %} {{ result_header(result, favicons, image_proxify) }} {{ result_sub_header(result) }} @@ -18,11 +18,7 @@ {{- result_sub_footer(result) -}} {% if result.iframe_src -%} {%- endif %} {{ result_footer(result) }}