From 0b832f19bf6590f099c572686d847db7cf7487e9 Mon Sep 17 00:00:00 2001 From: Grant Lanham Date: Tue, 10 Sep 2024 21:44:30 -0400 Subject: [PATCH] [fix] Removes ``/>`` ending tags for void HTML elements Removes ``/>`` ending tags for void elements [1] and replaces them with ``>``. Part of the larger cleanup to cleanup invalid HTML throughout the codebase [2]. [1] https://html.spec.whatwg.org/multipage/syntax.html#void-elements [2] https://github.com/searxng/searxng/issues/3793 --- docs/admin/api.rst | 10 +++++----- searx/botdetection/link_token.py | 2 +- searx/engines/btdigg.py | 1 - searx/templates/simple/base.html | 14 +++++++------- searx/templates/simple/categories.html | 2 +- searx/templates/simple/elements/infobox.html | 2 +- searx/templates/simple/preferences.html | 6 +++--- searx/templates/simple/preferences/cookies.html | 4 ++-- searx/templates/simple/preferences/footer.html | 4 ++-- searx/templates/simple/result_templates/map.html | 4 ++-- searx/templates/simple/results.html | 2 +- 11 files changed, 25 insertions(+), 26 deletions(-) diff --git a/docs/admin/api.rst b/docs/admin/api.rst index 8f4552f9c..8bd563ba7 100644 --- a/docs/admin/api.rst +++ b/docs/admin/api.rst @@ -84,9 +84,9 @@ HTML of the site. URL of the SearXNG instance and values are customizable. .. code:: html
- - - - - + + + + +
diff --git a/searx/botdetection/link_token.py b/searx/botdetection/link_token.py index 7a484d6d5..8f8e9839c 100644 --- a/searx/botdetection/link_token.py +++ b/searx/botdetection/link_token.py @@ -28,7 +28,7 @@ And in the HTML template from flask a stylesheet link is needed (the value of + type="text/css" > .. _X-Forwarded-For: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For diff --git a/searx/engines/btdigg.py b/searx/engines/btdigg.py index 193785182..5743f4142 100644 --- a/searx/engines/btdigg.py +++ b/searx/engines/btdigg.py @@ -54,7 +54,6 @@ def response(resp): excerpt = result.xpath('.//div[@class="torrent_excerpt"]')[0] content = html.tostring(excerpt, encoding='unicode', method='text', with_tail=False) - # it is better to emit
instead of |, but html tags are verboten content = content.strip().replace('\n', ' | ') content = ' '.join(content.split()) diff --git a/searx/templates/simple/base.html b/searx/templates/simple/base.html index ff9b610f6..4aeab383a 100644 --- a/searx/templates/simple/base.html +++ b/searx/templates/simple/base.html @@ -1,7 +1,7 @@ - + @@ -13,23 +13,23 @@ {% block title %}{% endblock %}{{ instance_name }} {% block meta %}{% endblock %} {% if rtl %} - + {% else %} - + {% endif %} {% if get_setting('server.limiter') or get_setting('server.public_instance') %} - + {% endif %} {% block styles %}{% endblock %} {% block head %} - + {% endblock %} - +
@@ -65,7 +65,7 @@